diff options
Diffstat (limited to 'src/kernel/malloc.h')
-rw-r--r-- | src/kernel/malloc.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/kernel/malloc.h b/src/kernel/malloc.h index 671a468..03934de 100644 --- a/src/kernel/malloc.h +++ b/src/kernel/malloc.h @@ -3,8 +3,6 @@ #include <shared/mem.h> #include <stddef.h> -extern struct malloc_hdr *malloc_last; - void mem_init(void *memtop); void mem_reserve(void *addr, size_t len); void mem_debugprint(void); @@ -19,11 +17,12 @@ void *page_zalloc(size_t pages); void page_free(void *first, size_t pages); void kmalloc_sanity(const void *addr); -void *kmalloc(size_t len); +void *kmalloc(size_t len, const char *desc); void kfree(void *ptr); -static inline void *kzalloc(size_t len) { - void *b = kmalloc(len); +// TODO calloc +static inline void *kzalloc(size_t len, const char *desc) { + void *b = kmalloc(len, desc); memset(b, 0, len); return b; } |