From 451868723fc1b639f179fe9593986f72a485f0bd Mon Sep 17 00:00:00 2001 From: Gwilym Kuiper Date: Mon, 21 Mar 2022 23:01:38 +0000 Subject: [PATCH] Add dealloc_no_normalise --- agb/src/agb_alloc/block_allocator.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/agb/src/agb_alloc/block_allocator.rs b/agb/src/agb_alloc/block_allocator.rs index c029522e..99248e66 100644 --- a/agb/src/agb_alloc/block_allocator.rs +++ b/agb/src/agb_alloc/block_allocator.rs @@ -157,6 +157,11 @@ impl BlockAllocator { } pub unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout) { + self.dealloc_no_normalise(ptr, layout); + self.normalise(); + } + + pub unsafe fn dealloc_no_normalise(&self, ptr: *mut u8, layout: Layout) { let new_layout = Block::either_layout(layout).pad_to_align(); free(|key| { let mut state = self.state.borrow(*key).borrow_mut(); @@ -195,7 +200,6 @@ impl BlockAllocator { } } }); - self.normalise(); } }