This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Extreme PRE compile times
On Thursday 13 November 2003 23:12, Daniel Berlin wrote:
> > > > This all is probably not too hard to implement for the page allocator
> > > > (dunno about ggc-simple/ggc-zone, or what would happen on
> > > > out-of-memory, or...). The thing is, right now it would have to be
> > > > implemented for _three_ different collectors :-(
> > >
> > > The zone collector can do this trivially. Just create a new zone at the
> > > beginning of the pass, and free it at the end!
> >
> > What happens if some objects in the zone are still live? Copying?
>
> You said the pass would be responsible for making sure nothing points to
> freed objects.
>
> I assumed you meant that all objects in the pool would be freed at the end
> of the pass. If you want to still have live objects in it, then we just
> wouldn't destroy the zone at the end, and everything would be happy.
Hmm no. I said that the pass would be responsible for making sure that, when
it *frees* an object, nothing points to it -- or at least that's what I
wanted to say. This is obviously necessary to avoid major catastrophies.
However, that does not imply that at the end of the pass the whole arena has
to be empty. Whatever is still in it was never freed, so it cannot be
collected and needs to be released into the global GC space.
What I had in mind is a set of pages reserved for the arena, per order,
whatever is required (easy determine at runtime when allocating objects in
the arena). These pages would eventually get linked to the global (per-order)
page lists again, but only at the end of the pass when the arena is released.
This way, the pages don't have to be free at the end of the pass, and they may
be filled with other "resident" objects during later passes.
Obviously if one would know for sure that an object would "survive" the pass,
then you wouldn't allocate it in the arena, but in the global GC space, and
perhaps also copy everything that it points to from the arena to the global
GC space.
What has me worries most with this idea is that arenas cannot simply be GC
roots (you don't know what's in them), so you wouldn't be able to call
ggc_collect during a pass. Not that we really need to (except PRE, of
course ;-) but it seems rather fragile. Apparently the zone collector could
come to the rescue here, too?
> Also note that because we haven't changed how marking works in the zone
> allocator marking any zones marks all zones.
Yup, I saw the comments. It apparently has the potential for a real solution,
but it's not there yet.
Gr.
Steven