diff options
Diffstat (limited to 'src/alloc.c')
| -rw-r--r-- | src/alloc.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/alloc.c b/src/alloc.c index c13b1e8..830e49f 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -12,13 +12,7 @@ #include "alloc.h" #include "constants.h" #include "free_list.h" - -typedef struct header { - size_t size; - size_t magic_number; -} header; - -static_assert(sizeof(header) % ALIGNMENT == 0, "Header improperly aligned"); +#include "alloc_header.h" static void *heap_start = 0; static void *heap_end = 0; @@ -59,7 +53,7 @@ void *allocate(size_t size) { /* first check for a suitable memory block on the free list */ free_nd *nd = fl_find_first_fit(free_list, size); if (nd) { - void *return_region = fl_split_node(free_list, nd, size); + void *return_region = fl_split_node(&free_list, nd, size); } /* @@ -82,6 +76,6 @@ void *allocate(size_t size) { } void release(void *ptr) { - fl_add_node(free_list, ptr); + fl_add_node(&free_list, ptr); fl_coalesce_nodes(free_list); } |