Will the D GC be awesome?

Alex Rønne Petersen alex at lycus.org
Thu Oct 4 06:27:58 PDT 2012


On 04-10-2012 15:21, Piotr Szturmaj wrote:
> Jacob Carlborg wrote:
>> On 2012-10-04 14:36, Alex Rønne Petersen wrote:
>>
>>> Presumably speed; returning small structs in registers will be faster
>>> than doing so on the stack.
>>
>> Are sturcts currently always returned on the stack?
>
> From: http://dlang.org/abi.html, for Windows x86 extern(D):
>
> * 1, 2 and 4 byte structs are returned in EAX.
> * 8 byte structs are returned in EDX,EAX, where EDX gets the most
> significant half.
> * For other struct sizes, the return value is stored through a hidden
> pointer passed as an argument to the function.

I strongly advise ignoring the D calling convention. Only DMD implements 
it and nowhere else than on Windows for 32-bit x86.

Instead, refer to the Windows and System V x86 ABIs.

-- 
Alex Rønne Petersen
alex at lycus.org
http://lycus.org


More information about the Digitalmars-d mailing list