I'm looking for a decent C memory allocator for my console. I've done research and know of a few memory allocators (liballoc, dlalloc coming to mind) but they require that an operating system or an overlord (lack of a better word ) to provide pages to use. I know I could fake paging easily using a simple bitmap, but I was wondering if there was a mature allocator which was designed to work with flat memory addressing without the extra overhead.
In the BEST case situation, I'd like a system where I can say "use memory 1MB to 24MB for malloc, use memory 24MB to 4GB for hmalloc (hardware malloc)", but I know it won't be that easy (I'm thinking I'll need two memory allocators working simultaneously).
C Allocator for flat memory console system
- AndrewAPrice
- Member
- Posts: 2299
- Joined: Mon Jun 05, 2006 11:00 pm
- Location: USA (and Australia)
Re: C Allocator for flat memory console system
Hi,
Dlmalloc doesn't require paging. The stock dlmalloc.c just requires one function from the kernel iirc - sbrk (it can use mmap too). Sbrk is of course perfect for a linear address space. It should just work "out of the box" for you.
Cheers,
James
Dlmalloc doesn't require paging. The stock dlmalloc.c just requires one function from the kernel iirc - sbrk (it can use mmap too). Sbrk is of course perfect for a linear address space. It should just work "out of the box" for you.
Cheers,
James