www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/12/29/13:25:02

From: alaric AT abwillms DOT demon DOT co DOT uk (Alaric B. Williams)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: windows <-> cwsdpmi
Date: Sun, 29 Dec 1996 12:29:46 GMT
Lines: 37
Message-ID: <851862547.18015.0@abwillms.demon.co.uk>
References: <851364688 DOT 618879 DOT 0 AT abwillms DOT demon DOT co DOT uk> <32C337E4 DOT 5C90 AT cam DOT org>
NNTP-Posting-Host: abwillms.demon.co.uk
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019