[Vm-dev] getting rid of pointer aliasing

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Fri Mar 4 21:46:46 UTC 2016

pointer aliasing is evil/dangerous on modern C Compiler.
Though it's kind of easy to remove most of them.
For example:

    self cCode:'((long *)addr)[0] = ((long *)(&floatValue))[0]'.

can easily become:

    self cCode: [self mem: addr cp: (self addressOf: floatValue) y: (self
sizeof: floatValue)].

Modern compiler will generate very efficient code for that.
Would you like me to proceed?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20160304/af9deacf/attachment.htm

More information about the Vm-dev mailing list