This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Copying collection and our ggc_collect practices
- From: Daniel Berlin <dberlin at dberlin dot org>
- To: gcc at gcc dot gnu dot org
- Date: Tue, 16 Sep 2003 14:46:18 -0400 (EDT)
- Subject: Copying collection and our ggc_collect practices
Currently, gcc has a bad habit of keeping ggc_alloc'd pointers in unmarked
local variables, and expecting the addresses not to change over a
ggc_collect.
This of course, prevents us from doing copying collection.
I've been experimenting with having a fixed size copy collected nursery in
the zone allocator, with things being promoted into the mark/sweep zones.
This lets us save a ton of marking time, which is the main gc time
expense, plus it greatly reduces memory fragmentation (since their's no
fragmentation in the nursery).
However, in order to do this, we need to either mark these locals that
store ggc_alloc'd pointers (which will cause them to be forwarded to the
new pointers properly), or stop expecting them to be valid over collections.
This is a problem, since the expectation of validity is rampant, and
there's no current way to GTY local variables.
Ideas?