From e9ddf8fda8ae474c8fcfdaf1ee2060b482c2c9cb Mon Sep 17 00:00:00 2001 From: Christopher Berner Date: Sun, 28 Jul 2024 18:39:37 -0700 Subject: [PATCH] Improve assertion message --- src/tree_store/page_store/buddy_allocator.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/tree_store/page_store/buddy_allocator.rs b/src/tree_store/page_store/buddy_allocator.rs index 284649f6..3b2adfb9 100644 --- a/src/tree_store/page_store/buddy_allocator.rs +++ b/src/tree_store/page_store/buddy_allocator.rs @@ -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);