Heap: Add a new block to the end of the linked list

*facepalm*

This was causing page faults when having two blocks and the first one (oldest one) being freed first.
This commit is contained in:
apio 2022-12-05 21:00:21 +01:00
parent d445b29477
commit 0edabd6d87
Signed by: apio
GPG Key ID: B8A7D06E42258954

View File

@ -222,6 +222,7 @@ Result<void*> kmalloc(usize size)
block->status = BLOCK_START_MEM | BLOCK_END_MEM; block->status = BLOCK_START_MEM | BLOCK_END_MEM;
block->next = nullptr; block->next = nullptr;
block->last = heap_end; block->last = heap_end;
heap_end->next = block;
heap_end = block; heap_end = block;
} }