Confirm alignment when calculating an offset to split at

This commit is contained in:
apio 2022-11-20 18:04:29 +01:00
parent 35b7194fb7
commit ff952fa2e4

View File

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