Returning fixed size arrays

John Colvin via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Jun 26 06:23:53 PDT 2014


On Thursday, 26 June 2014 at 12:06:34 UTC, bearophile wrote:
> John Colvin:
>
>> isn't this exactly what the System V ABI specifies anyway? 
>> Large aggregate returns are allocated on the calling stack, 
>> passed by hidden pointer.
>
> So do you know why D is not using that design?
>
> Bye,
> bearophile

It is, but a copy is made after the function returns anyway, for 
reasons unknown to me. For some reason the optimizer can't elide 
it (ldc2 -O5 -release, with a pragma(LDC_never_inline); inside 
foo).


More information about the Digitalmars-d-learn mailing list