Add skeleton for GlobalAlloc implementation

This commit is contained in:
Philipp Oppermann
2020-01-20 14:06:26 +01:00
parent 821dd2adb4
commit 93b4dcf434

View File

@@ -1,4 +1,5 @@
use alloc::alloc::Layout; use super::Locked;
use alloc::alloc::{GlobalAlloc, Layout};
use core::ptr; use core::ptr;
/// The block sizes to use. /// The block sizes to use.
@@ -50,3 +51,13 @@ impl FixedSizeBlockAllocator {
} }
} }
} }
unsafe impl GlobalAlloc for Locked<FixedSizeBlockAllocator> {
unsafe fn alloc(&self, layout: Layout) -> *mut u8 {
todo!();
}
unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout) {
todo!();
}
}