summaryrefslogtreecommitdiff
path: root/src/init
diff options
context:
space:
mode:
Diffstat (limited to 'src/init')
-rw-r--r--src/init/malloc.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/init/malloc.c b/src/init/malloc.c
index 35b1741..eb63d82 100644
--- a/src/init/malloc.c
+++ b/src/init/malloc.c
@@ -47,12 +47,8 @@ void free(void *ptr) {
}
static struct mblock *expand(size_t size) {
- size = (size + 4095) & ~4095; // round up to nearest page
-
- static void *start = (void*)0x80000000; // TODO workaround for unimplemented feature
- _syscall_memflag(start, size, MEMFLAG_PRESENT);
- struct mblock *block = start;
- start += size;
+ struct mblock *block = _syscall_memflag(0, size, MEMFLAG_PRESENT | MEMFLAG_FINDFREE);
+ if (!block) return NULL;
block->magic = MBLOCK_MAGIC;
block->length = size;