This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Ephemeral garbage [Was: GCC 3.2.1 -> GCC 3.3 compile speedregression]


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




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]