1
0
Fork 0
forked from koniifer/ableos
ableos-framebuffer/ableos/src/allocator/dummy.rs

15 lines
325 B
Rust
Raw Normal View History

2021-11-23 05:53:06 -06:00
use alloc::alloc::{GlobalAlloc, Layout};
use core::ptr::null_mut;
pub struct Dummy;
unsafe impl GlobalAlloc for Dummy {
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")
}
}