comp.lang.ada
 help / color / mirror / Atom feed
From: ncohen@watson.ibm.com (Norman H. Cohen)
Subject: Re: Great Circle and Ada?
Date: 1996/09/17
Date: 1996-09-17T00:00:00+00:00	[thread overview]
Message-ID: <51mj21$jif@watnews1.watson.ibm.com> (raw)
In-Reply-To: DxvLyG.J86@world.std.com


In article <DxvLyG.J86@world.std.com>, bobduff@world.std.com
(Robert A Duff) writes: 

|> In article <AE643969966856B24@dialup112-5-3.swipnet.se>,
|> Lars Farm <lars.farm@ite.mh.se> wrote: 
|> >What is virtual origin?
...
|> >... Is is a pointer into the interior of
|> >an allocated block rather than to the start of the block? If so, at least
|> >Boehms GC has no problems with it and Great Circle can probably handle
|> >interior pointers too.
|>
|> It's quite possible to implement GC with virtual origins, but the GC has
|> to know about it, and do the appropriate thing (just like the
|> compiler-generated code does).  This requires some cooperation between
|> the compiler and the GC (which is a Good Thing anyway, IMHO, but is not
|> the case with gcc/GNAT).

However, a CONSERVATIVE garbage collector makes guesses about which words
are pointers precisely because it has no information about how the
compiler has laid out storage.  The only knowledge exploited by a
conservative garbage collector is knowledge of the data structure
(typically boundary tags) used by the run-time system's allocator.  If a
word contains a value that happens to lie between the addresses of the
beginning and ending boundary tags for an allocated block, the
conservative collector marks that block as reachable, and goes on to
examine the words in that block in the same manner.  (For typical
versions of malloc, it is possible to find all boundary tags by
recognizing the first word on the heap as a beginning tag, using the
length information to find the corresponding closing tag, recognizing the
next word as the beginning tag of the next block, and so forth.)

If a compiler uses virtual origins, then a block may be, in effect,
pointed to by a word whose value does not lie between the addresses of
the beginning and ending boundary tags.

--
Norman H. Cohen    ncohen@watson.ibm.com




  reply	other threads:[~1996-09-17  0:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-09-17  0:00 Great Circle and Ada? Lars Farm
1996-09-17  0:00 ` Robert A Duff
1996-09-17  0:00   ` Norman H. Cohen [this message]
1996-09-18  0:00     ` Robert A Duff
  -- strict thread matches above, loose matches on Subject: below --
1996-09-14  0:00 John G. Volan
1996-09-15  0:00 ` Robert Dewar
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox