This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: How to use the garbage collector?
On Tue, Jan 02, 2001 at 06:57:45PM +1100, Fergus Henderson wrote:
> 1. Delete obstack code.
> 2. Register your roots.
> 3. Mark your types.
Yep.
> I think you probably also need to register any local variables which
> contain pointers to GC'd memory, and which are not linked to from
> other memory that will be traced, and which are live when ggc_collect
> () is called.
See the use of ggc_push_context and ggc_pop_context in e.g.
cp/semantics.c for an alternative to marking local variables.
r~