This is the mail archive of the
glibc-bugs@sources.redhat.com
mailing list for the glibc project.
[Bug libc/167] malloc() eats excess ram
- From: "bluefoxicy at linux dot net" <sourceware-bugzilla at sources dot redhat dot com>
- To: glibc-bugs at sources dot redhat dot com
- Date: 18 May 2004 21:01:19 -0000
- Subject: [Bug libc/167] malloc() eats excess ram
- References: <20040516194648.167.bluefoxicy@linux.net>
- Reply-to: sourceware-bugzilla at sources dot redhat dot com
------- Additional Comments From bluefoxicy at linux dot net 2004-05-18 21:01 -------
Interesting thought. mmap() lets you force it to fail if you can't map new ram
to a given address. You could use this for realloc(). Other than that, you
could "try" to get mmap() to give you contiguous segments, but keep track of
them in your own table (on the heap or in a specially allocated mmap() block)
either way, so that you can effectively use whatever mmap() gives you as a
scattered heap. The difference would be that when you have chunks in the middle
unallocated, you can free them back to the system.
This would be a crossbreed between what I understand to be the current
heap-based malloc() code in glibc/malloc/ and the current mmap() fallback in
glibc/malloc, right? It might work excessively well.
--
http://sources.redhat.com/bugzilla/show_bug.cgi?id=167
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.