[D-runtime] Precise garbage collection

Rainer Schuetze r.sagitario at gmx.de
Fri Jun 28 14:28:54 PDT 2013


On 28.06.2013 16:16, Steven Schveighoffer wrote:
> Another consideration to think about -- we currently have no calls
> to non-class finalizers in the GC.  Using TypeInfo pointers would
> facilitate this.

I think that could also be implemented by wrapping struct types with
destructor in a class that contains the struct. That would go in
_d_newitem* or _d_newarray*. Creating the appropriate type info at
runtime might be a problem though.

> I feel like this may tip the scales towards an all-TypeInfo
> solution.

There is still the problem of manually arranged data to be solved. E.g. 
the associative array combine node-list entry, key and value into a 
single allocation, and only the single type infos are available (if at 
all). Same problem as above: how to create a combined type info at runtime?

The current implementation "emplaces" the pointer bits at the 
corresponding addresses, but this needs two additional calls into the 
GC, resulting in far from optimal performance.


More information about the D-runtime mailing list