RE: [GD-Windows] memory alignment vs passing by value
Brought to you by:
vexxed72
From: Jon W. <hp...@mi...> - 2004-12-02 02:07:41
|
> It seems weird that aliasing would be a problem - since everything is in > 4 bytes chunks. From what I understood about aliasing, that only > mattered if you broke dword alignment, e.g. That's CPU register and memory aliasing, which is not the kind of aliasing I'm talking about. In compilers, any access through a pointer might conceivably change the value of the pointer itself (for example), so each time the pointer is accessed, it has to be re-loaded. There are type-based proofs the compiler can execute to not have to do this all the time, but most compilers are quite conservative. A simple disassembly of the two cases should tell you whether this is the case. Cheers, / h+ |