buddy: replace free-lists with binary tree

before this patch, the buddy allocator used a hybrid bitmap-freelist
approach where free would use the bitmap to determine size, but all
other operations we O(n) traversals of the free-list.

now, both alloc and free use the bitmap exclusively for allocation.
This commit is contained in:
Michael Shaw 2023-04-29 00:15:50 -04:00
commit 9222a373fc
5 changed files with 83 additions and 146 deletions

View file

@ -7,7 +7,7 @@
size_t log2(size_t n);
size_t npow2(size_t n);
void bitmap_set(char *bitmap, size_t n);
void bitmap_set(char *bitmap, size_t n, uint64_t b);
void bitmap_clear(char *bitmap, size_t n);
uint8_t bitmap_get(char *bitmap, size_t n);