[D-runtime] Precise garbage collection

Rainer Schuetze r.sagitario at gmx.de
Sun Jun 23 06:07:12 PDT 2013


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.

>
> I would encourage an implementation of all options (if you are so
> inclined), and see which one, or which mix, performs better.  It may
> be an easy call at that point.
>

But probably not so easy to get to that point ;-) I'll see if I find the 
time to implement some options. Even if dynamic arrays fit well into the 
design, I still have to find a way to squeeze the memory layout of 
associative arrays into it.



More information about the D-runtime mailing list