Ephemeral garbage [Was: GCC 3.2.1 -> GCC 3.3 compile speed regression]
Segher Boessenkool
segher@koffie.nl
Sun Feb 2 05:20:00 GMT 2003
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.
Segher
More information about the Gcc
mailing list