compile time garbage collection

via Digitalmars-d digitalmars-d at puremagic.com
Sat May 2 09:24:15 PDT 2015


On Saturday, 2 May 2015 at 16:13:36 UTC, ketmar wrote:
> On Sat, 02 May 2015 15:10:10 +0000, Freddy wrote:
>
>> How crazy hard would it be to have a front end optimization 
>> pass that
>> would try to replace garbage collector calls with malloc / 
>> free?
>
> impossible.

Not impossible, but if you can do it you probably often can 
replace it with a stack allocation. Though, if D gets 
"non-shared" semantics right and a high level intermediate 
representation with whole program optimization then it should be 
possible to do more. I.e. if you know that an object isn't 
accessed by another thread ever, then you have something easier 
to analyze.


More information about the Digitalmars-d mailing list