This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Using ggc-page with plain malloc
- To: oliva at lsd dot ic dot unicamp dot br
- Subject: Re: Using ggc-page with plain malloc
- From: "Martin v. Loewis" <martin at loewis dot home dot cs dot tu-berlin dot de>
- Date: Sun, 16 Jan 2000 20:59:01 +0100
- CC: gcc at gcc dot gnu dot org
- References: <orhfgef6lo.fsf@garnize.lsd.ic.unicamp.br>
> 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