Garbage Collector interface - GTY
Geoff Keating
geoffk@geoffk.org
Sat Feb 22 23:02:00 GMT 2003
Josef Zlomek <zlomj9am@artax.karlin.mff.cuni.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@geoffk.org>
More information about the Gcc
mailing list