From c1d3ac750b8483c9a942d2fb5d5b7245d014e905 Mon Sep 17 00:00:00 2001 From: dzwdz Date: Sat, 13 Jul 2024 23:37:37 +0200 Subject: kernel/malloc: limit the maximum allocation size to under a page This will likely be changed back, but for the time being it will let me implement a better allocator without too much effort. --- src/kernel/malloc.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/kernel/malloc.h') diff --git a/src/kernel/malloc.h b/src/kernel/malloc.h index 03934de..3469f5f 100644 --- a/src/kernel/malloc.h +++ b/src/kernel/malloc.h @@ -3,12 +3,16 @@ #include #include +/* This seems to be fine for now, and it means that i don't need to concern + * myself with allocating contiguous pages for now, which is way easier to do + * well. */ +#define KMALLOC_MAX 2048 + void mem_init(void *memtop); void mem_reserve(void *addr, size_t len); void mem_debugprint(void); // allocates `pages` consecutive pages -// TODO deprecate void *page_alloc(size_t pages); // zeroes the allocated pages void *page_zalloc(size_t pages); -- cgit v1.2.3