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


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

Regards,
Martin

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