Skip to content

Commit

Permalink
Improve assertion message
Browse files Browse the repository at this point in the history
  • Loading branch information
cberner committed Aug 17, 2024
1 parent 8513b21 commit e9ddf8f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/tree_store/page_store/buddy_allocator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,12 @@ impl BuddyAllocator {
/// data must have been initialized by Self::init_new()
pub(crate) fn free(&mut self, page_number: u32, order: u8) {
debug_assert!(self.get_order_free_mut(order).get(page_number));
debug_assert!(self.get_order_allocated(order).get(page_number));
debug_assert!(
self.get_order_allocated(order).get(page_number),
"Attempted to free page {}, order {}, which is not allocated",
page_number,
order
);

self.get_order_allocated_mut(order).clear(page_number);

Expand Down

0 comments on commit e9ddf8f

Please sign in to comment.