This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
GTY GC question
- From: Andrew MacLeod <amacleod at redhat dot com>
- To: gcc mailing list <gcc at gcc dot gnu dot org>
- Date: 28 Nov 2003 15:46:46 -0500
- Subject: GTY GC question
So I've got a structure which needs to be garbage collected, and it
contains a pointer to a chunk of memory which is *not* to be garbage
collected. like so:
typedef struct X
{
int num;
tree **vec;
} X_t;
and this structure is used inside inside a garbage colected structure:
struct P GTY(())
{
X_t x;
X_t y;
}
gengtype complains that it doesn't know about X_t, so I change it to:
typedef struct X GTY(())
{
int num;
tree **vec;
} X_t;
then it complains that vec is of an "unimplemented type".
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?
Andrew