compile time garbage collection

ketmar via Digitalmars-d digitalmars-d at puremagic.com
Sat May 2 21:46:52 PDT 2015


On Sun, 03 May 2015 04:40:42 +0000, 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.

i don't thing that such pass in general worth the efforts. D programmers 
tend to use structures for local and short-lived objects. if i did `new`, 
chances are that i really want it on heap, and it will not be optimisable 
(i either returning pointer, or passing it to some function that stores 
it somewhere).

so it can catch very rare cases for the cost of expensive interprocedural 
analysis. this makes some sense for C++, though.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20150503/aee736a4/attachment.sig>


More information about the Digitalmars-d mailing list