LRU cache for ~=

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Mon Oct 19 15:55:20 PDT 2009


dsimcha wrote:
> Started playing w/ the implementation a little and I see a problem.  What about
> the garbage collector?  There are two possibilities:
[snip]
> The only possible solutions I see would be to have the GC know everything about
> the LRU cache and evict stale entries (probably slows down GC a lot, a huge PITA
> to implement, couples things that shouldn't be tightly coupled), or clear the
> cache every time GC is run (probably would make appending so slow as to defeat the
> purpose of having the cache).

I think GC.collect may simply evict the entire cache. The collection 
cycle costs so much, the marginal cost of losing cached information is 
lost in the noise.

Andrei



More information about the Digitalmars-d mailing list