This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC 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: Heap allocation on Linux


I just found _ucreate from OS/2, which would fit my needs.
Do you know if that s available somewhere for Linux also?
Thanks
-jec

> 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
>
>
>


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