2021-11-27 09:19:08 -06:00
|
|
|
/*!
|
|
|
|
The allocator to be implemented by ableOS
|
|
|
|
*/
|
|
|
|
|
2021-11-23 05:53:06 -06:00
|
|
|
use alloc::alloc::{GlobalAlloc, Layout};
|
|
|
|
use core::ptr::null_mut;
|
|
|
|
|
2021-11-27 09:19:08 -06:00
|
|
|
pub struct AAloc;
|
2021-11-23 05:53:06 -06:00
|
|
|
|
2021-11-27 09:19:08 -06:00
|
|
|
unsafe impl GlobalAlloc for AAloc {
|
2021-11-23 05:53:06 -06:00
|
|
|
unsafe fn alloc(&self, _layout: Layout) -> *mut u8 {
|
|
|
|
null_mut()
|
|
|
|
}
|
|
|
|
|
|
|
|
unsafe fn dealloc(&self, _ptr: *mut u8, _layout: Layout) {
|
|
|
|
panic!("dealloc should be never called")
|
|
|
|
}
|
|
|
|
}
|