Heap allocation on Linux
jec@rptec.ch
jec@rptec.ch
Sat Dec 4 10:17:00 GMT 2004
Hi,
We have a big soft written in C++, so we have a lot of new/delete
On Windows, we use the Heap function from, Win32 API, and that s working
fine.
Does someone knows of something similar on Linux?
The problem is:
- Allocating block A (brk() is called to extend virtual address space)
- Allocating block B (brk() is called to extend virtual address space)
- Allocating block C (brk() is called to extend virtual address space)
- Allocating block D (brk() is called to extend virtual address space)
- Mem used is X
- Releasing block A
- Releasing block B
- Releasing block C
- Shrink addr space (No shrink since block D is still needed)
- Mem used is still X
That s a problem for our soft. What would be good is a mmap() based
allocator:
- Allocate an mmap chunk
- Allocate from it
- munmap it when all blocks are freed
Thanks for infos.
-jec
More information about the Gcc
mailing list