Complex.c

Ben Phillips Ben_member at pathlink.com
Sun Apr 30 15:20:42 PDT 2006


In article <e33at8$2r49$1 at digitaldaemon.com>, Craig Black says...
>
>I notice that there was both C and D source in the phobos internal library
>code.  Anyone know why?
>
>Another thing ... I looked at complex.h and noticed that the functions were
>passing Complex by value.  That is not as efficient as using references for
>a data structure with 2 long doubles.  Given that a long double is 80 bits,
>and each needs to be aligned appropriately, the Complex data structure is at
>least 8 bytes long.  So it seems that passing by reference would be faster,
>but maybe I'm missing something.
>
>-Craig
>

I believe its because types such as creal and such are primitives and are
allocated on the stack.





More information about the Digitalmars-d mailing list