How to use the garbage collector?

Richard Henderson rth@redhat.com
Tue Jan 2 01:06:00 GMT 2001


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~


More information about the Gcc mailing list