This is the mail archive of the libc-help@sourceware.org mailing list for the glibc 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: 32 bit malloc on x86_64


On Tue, 8 Jul 2008, Carlos O'Donell wrote:

On Mon, Jul 7, 2008 at 12:49 PM, Jeremy Sanders <jss@ast.cam.ac.uk> wrote:
I have come up with a workaround, which is to use mmap myself to allocate
the memory with the MAP_32BIT flag. This appears to work okay in test I have
done, but it is a pain as I have to keep track of the allocated length for
munmap. I read that MAP_32BIT really only gives you 31 bits of memory, but
this program doesn't use huge amounts of memory.

Is this a sensible way to proceed?

It seems perfectly sensible. Why is this a pain? Isn't it only one mmap, and at program exit one munmap?

The program allocates memory and deallocates it as it runs, so there's no fixed size block of memory. My mmap code seems to work, but I just wanted to know whether there is a better solution, and why the mallopt command is now being ignored by linux/glibc.


Thanks

Jeremy

--
Jeremy Sanders <jss@ast.cam.ac.uk>   http://www-xray.ast.cam.ac.uk/~jss/
X-Ray Group, Institute of Astronomy, University of Cambridge, UK.
Public Key Server PGP Key ID: E1AAE053


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