This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: 32 bit malloc on x86_64
- From: "Carlos O'Donell" <carlos at systemhalted dot org>
- To: "Jeremy Sanders" <jss at ast dot cam dot ac dot uk>
- Cc: libc-help at sourceware dot org
- Date: Tue, 8 Jul 2008 11:55:25 -0400
- Subject: Re: 32 bit malloc on x86_64
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender :to:subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references :x-google-sender-auth; bh=s3S67/aJ8dqW+CLl216R6EQQBkPppbCTpTb5LVLpJbs=; b=lw0XBmrZavV2nDUtnkDMlNnrmvIyk4YfKh5jShKtKyhDGX5l/MKOYABorotRqBQEBa AKxeUQBxKk8Vrjpb8DU5e5t+gpkVTqWdpT2eo+akXRgN+upR6K4/qpNYJNRT3HNF7Lfh fvUwSqnMDNf6K/qo2Ur/A9K6GLwlpZOaEnLIA=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references:x-google-sender-auth; b=gkw45XKLPUToHisQ/myE1EmqDH7H+1dJfd9zR/2j/Y4eC3/YnUgtJM38QXqjD3IKL5 tqIWjXe3v/F7DxTpEmY27zx1qZ92DBW+V87fP/9O6PKTICCQpIFVq4OuWNtCukgwyiJs LKMZ4RYYUBopVMbau0ygjhPn1SGox9ybyokwQ=
- References: <alpine.LFD.1.10.0807071738070.10528@xpc17.ast.cam.ac.uk> <119aab440807080802g47809805ib58f91dd8944a354@mail.gmail.com> <alpine.LFD.1.10.0807081614220.8090@xpc17.ast.cam.ac.uk>
On Tue, Jul 8, 2008 at 11:15 AM, Jeremy Sanders <jss@ast.cam.ac.uk> wrote:
> 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.
Write a slab allocator.
The mallopt command interacts with the glibc arena allocator, and it
should work as advertised.
Have you tried using the environment variable e.g. MALLOC_MMAP_MAX_=0?
It may be that by the time you call malloc the arena has already been
initialized with mmap'd memory.
Cheers,
Carlos.