This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC] cleanup frontend GC memory (decls and types)
>>>>> "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