Mail Archives: djgpp/1996/12/29/13:25:02
Tudor <tudor AT cam DOT org> wrote:
>The GC I read about had the same problem:anything that had a pointer to
>itself stayed,so a circular list really busted the GC :
>........
>void *a,*b,*c;
>a=&b;
>b=&c;
>c=&a;
>......
>at this point,even if the three pointers aren't used anymore they stay
>because each of them is being pointed at(a circular list).
Ah, but if that circular list is not referenced anywhere, then when
the GC starts it's search (from the preallocated data, BSS, and stack
segments, not forgetting the registers), it never finds that list; so
they never get marked as in use, and are wiped!
That problem arises with GCs using reference counters - everything has
a reference counter, which is incremented when a pointer points to it,
and decremented when a pointer is pointed away from it. If the counter
is zero, it's safe to destroy.
ABW
--
"Simply drag your mother in law's cellphone number from the
Address Book to the Laser Satellite icon, and the Targeting
Wizard will locate her. Then follow the onscreen prompts for
gigawattage and dispersion pattern..."
(Windows for Early Warning and Defence User's manual P385)
Alaric B. Williams Internet : alaric AT abwillms DOT demon DOT co DOT uk
<A HREF="http://www.abwillms.demon.co.uk/">Hello :-)</A>
- Raw text -