This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Garbage Collector interface - GTY


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>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]