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:
parent
d445b29477
commit
0edabd6d87
@ -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;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user