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]

Re: Using ggc-page with plain malloc


On Jan 16, 2000, "Martin v. Loewis" <martin@loewis.home.cs.tu-berlin.de> wrote:

>> I've been trying to arrange for ggc-page to work upon plain malloc.
>> All it needs is some way to ask for a memory area aligned at a page
>> boundary.  It's a bit tricky, because of wide variations among the
>> malloc() implementations, but I believe it can made to work well
>> unless someone finds some platform that breaks the following program
>> in a way that is too hard to fix.

> Wouldn't it be simpler to use a system interface for obtaining aligned
> memory? valloc(3) is part of Single Unix, and it gives you
> sysconf(_SC_PAGESIZE)-aligned memory. In addition (or alternatively?),
> memalign gives you arbitrarily-aligned memory.

We already use valloc when it's available.  But there are systems that
don't support it, and that's precisely the fallback I'm trying to
create.

-- 
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


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