D array expansion and non-deterministic re-allocation

Sean Kelly sean at invisibleduck.org
Tue Nov 17 08:40:38 PST 2009


Denis Koroskin Wrote:

> Walter Bright Wrote:
> 
> > Denis Koroskin wrote:
> > > It is *non*-deterministic. The decision to reallocate depends (or will 
> > > depend) on LRU and it may be cleared by another thread (e.g. another 
> > > thread may reset it manually or via a GC cycle run).
> > 
> > The LRU is thread local.
> 
> It will then prevent a moving GC from being possible in D.
> 
> Otherwise, moving a block of data will invalidate LRU which will result in non-deterministic reallocation.

It won't work with the existing GC either.  If a page is completely emptied then it can be re-used for different sized allocations.  This is why the current cache is wiped during a collection.



More information about the Digitalmars-d mailing list