Continuation passing style vs. wrapper objects in dmd

Daniel N no at public.email
Wed May 26 15:03:09 UTC 2021


On Wednesday, 26 May 2021 at 05:18:57 UTC, Ola Fosheim Grostad 
wrote:
> On Wednesday, 26 May 2021 at 04:59:36 UTC, Ola Fosheim Grostad 
> wrote:
>>> int i = stat(stringz(name).ptr, &statbuf));
>>
>> This cannot...
>
> Well, actually it could use alloca if you are 100% sure stringz 
> is inlined, but it would be bad in a loop.

Thread necromancy yields:

ref E stalloc(E)(ref E mem = *(cast(E*)alloca(E.sizeof)))

Guaranteed to work as default parameter initialisation occurs in 
callers contex, but indeed loops are no fun.





More information about the Digitalmars-d mailing list