DCT: D compiler as a collection of libraries

Tobias Pankrath tobias at pankrath.net
Sat May 12 13:28:32 PDT 2012


> 1. If a struct is a field of heap allocated object, it will be
> allocated and garbage collected. Only if it only exists on stack
> (i.e., in method body), GC is not used.

As far as I can tell, it won't be allocated on it's own, since it 
is stored in the garbage collected object as a value field. So 
using a freelist would actually increase the overhead. You have 
to manage the freelist and do the allocation of the containing 
object.


More information about the Digitalmars-d-announce mailing list