This is the mail archive of the gcc-patches@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: [patch] Move loop structures to gc memory


On 5/18/07, Alexandre Oliva <aoliva@redhat.com> wrote:
On May 17, 2007, Zdenek Dvorak <rakdver@kam.mff.cuni.cz> wrote:

> no, it is a proper fix -- it makes us avoid using GC for purposes for
> that it is not suitable.

Why is it not suitable?
Because it's garbage collected memory for something that doesn't need
to, care about, or will ever be, garbage collected?


So far the only justification presented is that ggc_alloc is slower. I'm not aware of any fundamental reason why ggc_alloc must be slower than other memory allocators (other than alloca).

Well, first, have fun producing some patches to make it that way. I know Dan Jacobowitz spend > 1 month working on this.

Second the main justification is that the memory doesn't need to be
garbage collected, it just has some roots in it.

Why should things that don't need to be garbage collected, be in
garbage collected memory?
In other words, why would we put it there just because we could make
it possible to be there?
It doesn't make anything *better*, but it sure (currently, and for the
forseeable future) makes things worse!
If we could make ggc_alloc faster, would it still be unsuitable?



> using GC for objects for that you know exactly the lifetime and the > expected usage pattern at best wastes this extra information you > have.

You're not taking into account the need for tracking the pointers
inside these very objects into objects in GC memory.  It's not at all
obvious that, after adding in this extra information, you're still
saving anything.

We'll just have to agree to disagree until numbers are produced, I guess.


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