mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-24 00:31:34 +11:00
Add dealloc_no_normalise
This commit is contained in:
parent
e6d47afa31
commit
451868723f
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue