Add dealloc_no_normalise

This commit is contained in:
Gwilym Kuiper 2022-03-21 23:01:38 +00:00
parent e6d47afa31
commit 451868723f

View file

@ -157,6 +157,11 @@ impl BlockAllocator {
} }
pub unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout) { 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(); let new_layout = Block::either_layout(layout).pad_to_align();
free(|key| { free(|key| {
let mut state = self.state.borrow(*key).borrow_mut(); let mut state = self.state.borrow(*key).borrow_mut();
@ -195,7 +200,6 @@ impl BlockAllocator {
} }
} }
}); });
self.normalise();
} }
} }