Short list with things to finish for D2

Leandro Lucarella llucax at gmail.com
Thu Nov 19 13:01:46 PST 2009


dsimcha, el 19 de noviembre a las 17:01 me escribiste:
> > > Unfortunately, I've come to hate the MRU idea because it would fail miserably for
> > > large arrays.  I've explained this before, but not particularly thoroughly, so
> > > I'll try to explain it more thoroughly here.  Let's say you have an array that
> > > takes up more than half of the total memory you are using.  You try to append to
> > > it and:
> > >
> > > 1.  The GC runs.  The MRU cache is therefore cleared.
> > >
> > > 2.  Your append succeeds, but the array is reallocated.
> > >
> > > 3.  You try to append again.  Now, because you have a huge piece of garbage that
> > > you just created by reallocating on the last append, the GC needs to run again.
> > > The MRU cache is cleared again.
> > >
> > > 4.  Goto 2.
> > This is not a matter of principles, but one of implementation. When you
> > GC, you can adjust the cache instead of clearing it.
> 
> Technically true, but what is a matter of principles is whether the implementation
> of arrays should be very tightly coupled to the implementation of the GC.  Fixing
> this issue would have massive ripple effects throughout the already spaghetti
> code-like GC, and might affect GC performance.  For every single object the GC
> freed, it would have to look through the MRU cache and remove it from there if
> present, too.
> 
> The point is that this **can** be done, but we probably don't **want** to
> introduce this kind of coupling, especially if we want our GC model to be sane
> enough that people might actually come along and write us a better GC one day.

Amen!

-- 
Leandro Lucarella (AKA luca)                     http://llucax.com.ar/
----------------------------------------------------------------------
GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145  104C 949E BFB6 5F5A 8D05)
----------------------------------------------------------------------
now self-employed, concerned (but powerless),
an empowered and informed member of society (pragmatism not idealism),
will not cry in public, less chance of illness,
tires that grip in the wet (shot of baby strapped in back seat),



More information about the Digitalmars-d mailing list