use core::alloc::{GlobalAlloc, Layout};
use crate::memory::sys_alloc_aligned;
#[global_allocator]
pub static HEAP: BumpPointerAlloc = BumpPointerAlloc;
pub struct BumpPointerAlloc;
unsafe impl GlobalAlloc for BumpPointerAlloc {
unsafe fn alloc(&self, layout: Layout) -> *mut u8 {
sys_alloc_aligned(layout.size(), layout.align())
}
unsafe fn dealloc(&self, _: *mut u8, _: Layout) {
}
unsafe fn alloc_zeroed(&self, layout: Layout) -> *mut u8 {
self.alloc(layout)
}
}