dlmalloc or bitmap?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
ka3r

dlmalloc or bitmap?

Post by ka3r »

Hi,
I am writing the kernel allocator for my OS, and I do not know if I should implement a kernel heap and use the Doug Lea's malloc/free or if I should keep track of the free virtual address space using a bitmap.

I tried implementing a bitmap and I uses 133248 bytes of physical memory and I am not sure it is very efficient. I use this structure:

struct {
unsigned long spage_bitmap[32];
unsigned short spage_count[1024];
unsigned long page_bitmap[32768];
} kmem_bitmap;

Where 'spage_bitmap' is the bitmap of the 1024 superpages of 1024 pages, 'spage_count' is the number of free pages per superpage and 'page_bitmap' is the bitmap of the 1048576 virtual pages.
Post Reply