This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: GTY GC question
> On Fri, 2003-11-28 at 16:01, Jan Hubicka wrote:
> > >
>
> > > Now, vec points to memory which is managed in a different way. It won't
> > > get lost, but I dont want the garbage collector to do any more than
> > > simply collect the P structure, never touching what vec points to.
> > > struct P is the only hunk of memory which is actually GC allocaed. How
> > > do I do that?
> > I think you want something like this:
> > PTR GTY ((skip (""))) aux;
> > used by cgraph code. You must be sure that the structure is never
> > supposed to survive in precompiled header.
>
> Err, whats that mean in practical terms? "never suppose to survive in
> precompiled header" What makes a structure survive?
Precompiled headers save/restore all GGC visible memory.
If you hide something behind GGC back, it won't get saved/restored that
is OK as long as you don't need it to be saved (that is for instance the
case of aux pointers in cgraph that are used only temporarily and never
survive across compilation passes)
If lifetime of your structure is across compilations of functions or
something like that, then you need to GTYize everything.
Honza
>
> Andrew
>