From 9ebc058188e1c0711ba6818b207a11513e54bf27 Mon Sep 17 00:00:00 2001 From: IoIxD Date: Thu, 22 Jan 2026 11:51:33 -0700 Subject: [PATCH] figured out how to make the block header smaller actually --- src/system/linux/alloc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/system/linux/alloc.c b/src/system/linux/alloc.c index 424ef3b..6c16dde 100644 --- a/src/system/linux/alloc.c +++ b/src/system/linux/alloc.c @@ -15,7 +15,6 @@ struct msh_linux_block_t { msh_linux_block *prev; msh_linux_block *next; unsigned char free; - char data[1]; }; #define MSH_BLOCK_SIZE 21 @@ -50,7 +49,7 @@ static msh_linux_block *extend_heap(msh_linux_block *last, SIZE_TYPE size) { static void split_block(msh_linux_block *b, SIZE_TYPE size) { msh_linux_block *new; - new = (msh_linux_block *)b->data + size; + new = ((msh_linux_block *)&b->free) + size + 1; new->size = b->size - size - MSH_BLOCK_SIZE; new->next = b->next; new->free = 1; @@ -103,7 +102,7 @@ void *msh_allocate(SIZE_TYPE size) { } msh_linux_base = b; } - return b->data; + return (&b->free) + 1; }; void msh_deallocate(void *ptr) {