mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-24 08:41:34 +11:00
make alloc and dealloc public
This commit is contained in:
parent
1849571344
commit
93d994360e
|
@ -112,7 +112,7 @@ impl BlockAllocator {
|
|||
});
|
||||
}
|
||||
|
||||
unsafe fn alloc(&self, layout: Layout) -> Option<NonNull<u8>> {
|
||||
pub unsafe fn alloc(&self, layout: Layout) -> Option<NonNull<u8>> {
|
||||
// find a block that this current request fits in
|
||||
let full_layout = Block::either_layout(layout);
|
||||
|
||||
|
@ -156,7 +156,7 @@ impl BlockAllocator {
|
|||
})
|
||||
}
|
||||
|
||||
unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout) {
|
||||
pub unsafe fn dealloc(&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();
|
||||
|
|
Loading…
Reference in a new issue