This is the mail archive of the
mailing list for the GCC project.
Re: [RFC] cleanup frontend GC memory (decls and types)
On Thu, 6 Mar 2008, Tom Tromey wrote:
> Michael> I'm not 100% sure what to make of this and if it's even
> Michael> worthwhile to continue on this path, so I'm asking for
> Michael> comments. Anyway, what I wanted to look at is to reduce the
> Michael> memory overhead of the (C++) frontend, after it is basically
> Michael> done with it's work, i.e. at the end of the IPA passes.
> I'm curious to know whether and how this affects build times.
I haven't measured this yet, but will do.
> Michael> Then I iterate over all things (identifiers, types and decls)
> Michael> and zero out several fields
> 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.
That only helps for getting rid of unused identifiers. That's is also
nice to have but not the same. The frontends hang off several data
structures from the identifier structure. The C++ frontend for instance
all binding levels that identifier was defined in (which includes template
scopes) and some template structures.
So even if an identifier is still used it can point to several other dead
data structures which also need to be cleaned up.