[D-runtime] Precise garbage collection

Steven Schveighoffer schveiguy at yahoo.com
Fri Jun 28 07:16:29 PDT 2013


On Jun 23, 2013, at 9:07 AM, Rainer Schuetze <r.sagitario at gmx.de> wrote:

> On 23.06.2013 00:48, Steven Schveighoffer wrote:
>> 
>> Note, you can have a mix of solutions -- for up to 16*sizeof(void*)
>> bytes allocations, store bitmaps.   For everything else, use a
>> typeinfo.  Both solutions could try off-page or in-block.  You can
>> use the same philosophy as array append code -- for non-extendable GC
>> blocks (i.e. < PAGE size) place at the end, for PAGE size and above,
>> place at the front.
> 
> I was thinking in the same direction, using bitmaps for anything < page size and typeinfo for larger blocks. The downside is that you have to implement both versions, and that you loose the flexibility of the bitmap for larger allocations. One way to solve this might be to switch to bitmaps once gc_emplace is used on large allocations.

Another consideration to think about -- we currently have no calls to non-class finalizers in the GC.  Using TypeInfo pointers would facilitate this.  I feel like this may tip the scales towards an all-TypeInfo solution.

See also: http://d.puremagic.com/issues/show_bug.cgi?id=9334 and http://d.puremagic.com/issues/show_bug.cgi?id=9335

-Steve


More information about the D-runtime mailing list