libluna: Assert some unreachable conditions
All checks were successful
Build and test / build (push) Successful in 1m48s

This commit is contained in:
apio 2024-03-07 23:10:35 +01:00
parent 2780ee2ebc
commit cdab3dea90
Signed by: apio
GPG Key ID: B8A7D06E42258954

View File

@ -166,12 +166,7 @@ static Result<void> 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<HeapBlock*> 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;
}