diff --git a/libluna/src/Heap.cpp b/libluna/src/Heap.cpp index 7f808303..44783998 100644 --- a/libluna/src/Heap.cpp +++ b/libluna/src/Heap.cpp @@ -166,12 +166,7 @@ static Result combine_forward(HeapBlock* block) if (next->status & BLOCK_END_MEM) { - if (next->status & BLOCK_START_MEM) - { - const usize pages = ceil_div(next->full_size + sizeof(HeapBlock), PAGE_SIZE); - TRY(release_pages_impl(next, pages)); - return {}; - } + if (next->status & BLOCK_START_MEM) { unreachable(); } else block->status |= BLOCK_END_MEM; } @@ -195,12 +190,7 @@ static Result combine_backward(HeapBlock* block) if (block->status & BLOCK_END_MEM) { - if (block->status & BLOCK_START_MEM) - { - const usize pages = ceil_div(block->full_size + sizeof(HeapBlock), PAGE_SIZE); - TRY(release_pages_impl(block, pages)); - return last; - } + if (block->status & BLOCK_START_MEM) { unreachable(); } else last->status |= BLOCK_END_MEM; }