Related articles |
---|
Recognising pointers during garbage collection? cymric73@hotmail.com (Maarten D. de Jong) (2003-07-21) |
Re: Recognising pointers during garbage collection? sven@clio.in-berlin.de (Sven Gohlke) (2003-07-23) |
Re: Recognising pointers during garbage collection? joachim.durchholz@web.de (Joachim Durchholz) (2003-07-23) |
Re: Recognising pointers during garbage collection? ftu@fi.ruu.nl (2003-07-25) |
Re: Recognising pointers during garbage collection? dobes@dobesland.com (Dobes Vandermeer) (2003-07-25) |
Re: Recognising pointers during garbage collection? fjh@cs.mu.oz.au (Fergus Henderson) (2003-07-25) |
Re: Recognising pointers during garbage collection? joachim.durchholz@web.de (Joachim Durchholz) (2003-07-25) |
Re: Recognising pointers during garbage collection? qrczak@knm.org.pl (Marcin 'Qrczak' Kowalczyk) (2003-07-25) |
Re: Recognising pointers during garbage collection? cymric73@hotmail.com (Maarten D. de Jong) (2003-07-25) |
Re: Recognising pointers during garbage collection? basile@starynkevitch.net (Basile STARYNKEVITCH) (2003-07-31) |
[5 later articles] |
From: | ftu@fi.ruu.nl (Dick Wesseling) |
Newsgroups: | comp.compilers |
Date: | 25 Jul 2003 21:07:13 -0400 |
Organization: | Wanadoo NL |
References: | 03-07-149 |
Keywords: | GC |
Posted-Date: | 25 Jul 2003 21:07:13 EDT |
"Maarten D. de Jong" <cymric73@hotmail.com> writes:
> Can someone explain some of the more common
> techniques in uncooperative languages (like C) or cooperative ones (which
> you design yourself)?
I never did a GC for an uncooperative language, so I can only answer
the second part of your question. Consider Java. The symbol table of a
Java program is part of the run time environment, it is defined by the
Java Virtual Machine specification (the class file format). A storage
allocator for Java will typically store a reference to the class of an
object somewhere in the object. This is required for operations such
as instanceof and run time evaluation of casts.
During the mark phase a Java GC can use this reference to determine
the class of an object in the heap. Next the GC consults the symbol
table to determine which fields in the object are references that
point to other live objects and which fields are scalars that do not
point to objects.
Return to the
comp.compilers page.
Search the
comp.compilers archives again.