[GD-Windows] memory alignment vs passing by value
Brought to you by:
vexxed72
From: Andras B. <bn...@ma...> - 2004-12-01 22:34:37
|
I don't know about other platforms/compilers, but with MSVC, passing a 4 component floating point vector by value is far more efficient than passing it as a reference (could anyone explain why this is the case btw?). One more thing that can help performance is correct alignment in memory. Problem is, when I my vectors are aligned, then I cannot pass by value anymore, I'm forced to use reference. These requirements knock each other out, so what can I do? :) The interesting thing is that I can still create local variables on the stack, and they will be correctly aligned, but it cannot align the passed parameters? Why? Thanks, Andras |