Large Arrays and GC

Sean Kelly sean at invisibleduck.org
Fri May 9 14:12:49 PDT 2008


== Quote from Fawzi Mohamed (fmohamed at mac.com)'s article
> On 2008-05-09 18:20:19 +0200, bearophile <bearophileHUGS at lycos.com> said:
> > dsimcha Wrote:
> >> Does anyone know of another way to manually delete associative arrays?
> >
> > Time ago I have asked that question, and someone has shown me a way,
> > you can find a modified version of it as the clear() function in my
> > libs:
> > http://www.fantascienza.net/leonardo/so/libs_d.zip
> > [...]
> >
> > Bye,
> > bearophile
> Nice that there is a workaround, but shouldn't an AA:
> 1) possibly contain pointers
> 2) have no extrnal pointers pointing to its inside
> so is it possible to tell the gc to ignore internal pointer to it, but
> still (if kept) scan all the pointers contained in it?

The GC just deals in memory blocks, so the nodes of a chained AA
are just blocks containing pointers.  The GC doesn't know any more
than that, and it doesn't treat them any differently than any other
block containing pointers.


Sean



More information about the Digitalmars-d mailing list