Complex.c
Norbert Nemec
Norbert at Nemec-online.de
Mon May 1 09:39:04 PDT 2006
For inlining, it should not matter, whether the original function was
pass-by-value or pass-by-reference. The whole calling process is mangled
anyway, so the end result should not differ.
BCS wrote:
> Which is better inlined? Maybe it's an optimization issue.
>
> In article <e33eoq$2v4p$1 at digitaldaemon.com>, Craig Black says...
> [...]
>> It doesn't matter whether you are on the stack or on the heap. If you pass
>> a data structure by value, then you are pushing and popping the entire
>> contents of the data structure onto the stack every time you call the
>> function. I've run benchmarks and it is much better to pass by reference,
>> especially for large data structures.
>>
>> -Craig
>>
>>
>
>
More information about the Digitalmars-d
mailing list