compile time garbage collection

deadalnix via Digitalmars-d digitalmars-d at puremagic.com
Sat May 2 21:48:28 PDT 2015


On Sunday, 3 May 2015 at 04:40:44 UTC, weaselcat wrote:
> On Saturday, 2 May 2015 at 16:24:17 UTC, Ola Fosheim Grøstad 
> wrote:
>> Not impossible, but if you can do it you probably often can 
>> replace it with a stack allocation.
>
> AFAIK LDC already has a pass that does this, I'm not sure how 
> well it works.

If things do not escape and size is known, it works actually 
fairly well. Obviously, this kind of thing can only remove some 
allocations, but most will still ends up being freed by the GC.


More information about the Digitalmars-d mailing list