malloc-based ggc-page

Alexandre Oliva oliva@lsd.ic.unicamp.br
Wed Jan 19 17:23:00 GMT 2000


On Jan 18, 2000, Mark Mitchell <mark@codesourcery.com> wrote:

>>>>>> "Alexandre" == Alexandre Oliva <oliva@lsd.ic.unicamp.br> writes:
Alexandre> On Jan 18, 2000, Mark Mitchell <mark@codesourcery.com>
Alexandre> wrote:

>>> I question whether this is really worth it.

Alexandre> It is.  I, as a user of a system that used to use
Alexandre> ggc-slow (which should be the real name of ggc-simple
Alexandre> :-) because no other alternative was (known to be)
Alexandre> available, would be very much pleased to be able to use
Alexandre> ggc-page instead.

> I understand that avoiding ggc-simple is worth it -- I'm not sure
> whether your solution is optimal.  (But, by the way, didn't your
> system turn out to have an acceptable mmap?)

Yup.  That particular system did.  But others might not be that
lucky...

> So, what real systems that people really use don't already come
> with, at the very least, valloc?

Dunno.  But Kaffe does support malloc, so someone must have met this
problem at some point.

> Then, I would still suggest that you implement valloc in libiberty.

BTW, why not just move the whole page allocation system into
libiberty.  I mean, including mmap anonymous, mmap /dev/zero and plain
valloc?  This would make it far more reusable!

> Give up on trying to free the memory -- just keep the allocated pages
> around and reuse them.

I'll try to figure out a configure test to detect whether valloc()ed
pages can be reused.  I can also try to find out whether valloc()ed
pages are too wasteful, as Jeff says, and revert to the malloc-based
approach if they're found to be.

-- 
Alexandre Oliva http://www.ic.unicamp.br/~oliva IC-Unicamp, Bra[sz]il
oliva@{lsd.ic.unicamp.br,guarana.{org,com}} aoliva@{acm,computer}.org
oliva@{gnu.org,kaffe.org,{egcs,sourceware}.cygnus.com,samba.org}
** I may forward mail about projects to mailing lists; please use them



More information about the Gcc-patches mailing list