This is the mail archive of the
mailing list for the GCC project.
Re: Ephemeral garbage [Was: GCC 3.2.1 -> GCC 3.3 compile speedregression]
- From: Segher Boessenkool <segher at koffie dot nl>
- To: "Timothy J. Wood" <tjw at omnigroup dot com>
- Cc: Ziemowit Laski <zlaski at apple dot com>, gcc at gcc dot gnu dot org,Geoffrey Keating <geoffk at apple dot com>
- Date: Sun, 02 Feb 2003 04:54:38 +0100
- Subject: Re: Ephemeral garbage [Was: GCC 3.2.1 -> GCC 3.3 compile speedregression]
- References: <75F91E2F-35BC-11D7-9F3F-0003933F3BC2@omnigroup.com>
Timothy J. Wood wrote:
> IMHO, the garbage collector should be used for objects with lifetimes that are difficult to determine. Local temporary stuff with easily computed lifetimes should be on a obstack or something similar and not get allocated from the GC. I imagine
this is harder than just saying that, but it may help to reduce the load on the garbage collector by creating less garbage.
The garbage collector could be expanded to make it possible
to *explicitly* deallocate a piece of GCable memory, and then
callers can use it to get rid of stuff they are sure they don't
need any more. This has the advantage that you don't need to
free stuff on unexpected/error paths, as the GC will take care
of it. ggc_free() or something like that would seem a good name.