mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-24 16:51:33 +11:00
no point checking if null and returning null
This commit is contained in:
parent
6523a3c6b8
commit
63d880f083
|
@ -45,14 +45,7 @@ impl BlockAllocator {
|
||||||
|
|
||||||
unsafe fn new_block(&self, layout: Layout) -> *mut u8 {
|
unsafe fn new_block(&self, layout: Layout) -> *mut u8 {
|
||||||
let overall_layout = Block::either_layout(layout);
|
let overall_layout = Block::either_layout(layout);
|
||||||
|
self.inner_allocator.alloc(overall_layout)
|
||||||
let block_ptr = self.inner_allocator.alloc(overall_layout);
|
|
||||||
|
|
||||||
if block_ptr.is_null() {
|
|
||||||
return core::ptr::null_mut();
|
|
||||||
}
|
|
||||||
|
|
||||||
block_ptr
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue