[RFC] cleanup frontend GC memory (decls and types)

Tom Tromey tromey@redhat.com
Fri Mar 7 15:53:00 GMT 2008


>>>>> "Michael" == Michael Matz <matz@suse.de> writes:

>> FWIW I have a patch to let the GC reclaim identifiers.  In my patch, 
>> after parsing the identifier table is turned into a weak hash.

Michael> That only helps for getting rid of unused identifiers.
Michael> That's is also nice to have but not the same.  The frontends
Michael> hang off several data structures from the identifier
Michael> structure.  The C++ frontend for instance all binding levels
Michael> that identifier was defined in (which includes template
Michael> scopes) and some template structures.

Michael> So even if an identifier is still used it can point to
Michael> several other dead data structures which also need to be
Michael> cleaned up.

Yeah, good point.  I'm more familiar with the C FE, which I think does
a decent job cleaning up the identifiers as it pops scopes.

Anyway, I'm generally in favor of changes like this -- patches that
change GC roots and whatnot to more accurately reflect how we think
things ought to work.  I am still curious about how this sort of thing
affects performance.

Tom



More information about the Gcc-patches mailing list