Heap: Just align it on a 16-byte boundary if it's not aligned

This commit is contained in:
apio 2022-12-06 18:21:19 +01:00
parent cccf89dd16
commit 2734353a5d
Signed by: apio
GPG Key ID: B8A7D06E42258954

View File

@ -85,8 +85,7 @@ static usize get_fair_offset_to_split_at(HeapBlock* block, usize min)
available -= (available / available -= (available /
2); // reserve half of the rest for the new block, while still leaving another half for the old one. 2); // reserve half of the rest for the new block, while still leaving another half for the old one.
check(is_aligned(available, available = align_down(available, 16UL); // Everything has to be aligned on a 16-byte boundary
16UL)); // If necessary, we can just align it. This is more of a sanity check than a requirement.
return available + block->req_size; return available + block->req_size;
} }