This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Garbage Collector interface - GTY
- From: Geoff Keating <geoffk at geoffk dot org>
- To: Josef Zlomek <zlomj9am at artax dot karlin dot mff dot cuni dot cz>
- Cc: gcc at gcc dot gnu dot org
- Date: 22 Feb 2003 11:25:43 -0800
- Subject: Re: Garbage Collector interface - GTY
- References: <20030222104543.GA17991@artax.karlin.mff.cuni.cz>
Josef Zlomek <zlomj9am at artax dot karlin dot mff dot cuni dot cz> writes:
> Hi,
>
> Although I know how to tell garbage collector to mark simple
> datastructures, I have a problem with the following one which is more
> complicated. I have read the documentation but it is too brief for me.
>
> The data structure is a dynamic array, each element is a struct of
> two members - the first and the last element of the chained list. The
> nodes (and their internals) of the chained list should be garbage
> collected I do not know how to tell GC not to mark the struct itself.
This is not supported, by design. Anything that refers to a GCed
object must be either a global variable or must be GCed itself; you
can't have references to GCed objects in malloced memory.
--
- Geoffrey Keating <geoffk at geoffk dot org>