Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Languages Misc > Re: GC Design Q...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 9 of 10 Topic 1122 of 1244
Post > Topic >>

Re: GC Design Question

by torbenm@[EMAIL PROTECTED] (Torben =?iso-8859-1?Q?=C6gidius?= Mogense Mar 25, 2008 at 04:02 PM

Pie Squared <PieSquared@[EMAIL PROTECTED]
> writes:


> Is it possible to make a conservative moving GC?
> [...]
> So, is there some way to have a conservative GC which moves it's
> objects around?

A moving GC changes the value of pointers, which is fine as long as
the new pointer value points to (a copy of) the same object as the old
pointer value.

A conservative GC is a GC that does not know which values in memory
are pointers.  So if the GC has a value that it is unsure is a pointer
or an integer (or real, character or anything other than a pointer to
the heap), it can not change it.  The traditional approach is let the
GC do something that is safe regardless of whether the value is a
pointer or an integer, i.e., keep the value unchanged and keep the
heap structure it points to live.  This precludes moving the heap
structure to another address, unless you leave a forwarding pointer
(and make the program transparently follow such forwarding pointers,
which sup****t from the compiler).  But if you leave forwarding
pointers, the advantage of moving objects (better locality, freeing up
the old heap space) is lost.

The way a conservative GC recognise a non-pointer is usually by its
value: If the value seen as a pointer points outside the heap or is
not aligned to whatever alignment the heap enforces, then it can not
be a heap pointer.

Recognising something that is definitely a heap pointer is more
difficult, as an integer can take any value.  So a GC needs extra
information to identify pointers.  Non-conservative GCs have the
compiler mark values as pointers or non-pointers, but conservative GCs
don't have that option (if they did, they would not be conservative).

	Torben
 




 10 Posts in Topic:
GC Design Question
Pie Squared <PieSquare  2008-03-20 15:04:31 
Re: GC Design Question
Nils M Holm <news2008@  2008-03-21 06:49:24 
Re: GC Design Question
"Aaron Gray" &l  2008-03-22 21:08:47 
Re: GC Design Question
Hallvard B Furuseth <h  2008-03-23 20:08:15 
Re: GC Design Question
Friedrich Dominicus <j  2008-03-24 07:48:59 
Re: GC Design Question
Hallvard B Furuseth <h  2008-03-25 17:05:11 
Re: GC Design Question
Hallvard B Furuseth <h  2008-03-25 17:06:18 
Re: GC Design Question
"cr88192" <c  2008-03-23 10:47:39 
Re: GC Design Question
torbenm@[EMAIL PROTECTED]  2008-03-25 16:02:48 
Re: GC Design Question
Waldek Hebisch <hebisc  2008-03-26 18:20:25 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Oct 6 11:05:06 CDT 2008.