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) {