PageAlloc

Trait PageAlloc 

Source
pub unsafe trait PageAlloc {
    // Required methods
    fn alloc_page(&self, size: usize) -> Result<NonNull<[u8]>, AllocError>;
    unsafe fn dealloc_page(&self, page: NonNull<[u8]>);
}
Expand description

§Safety

moving an implementation of this trait shouldn’t invalidate currently allocated pages.

Required Methods§

Source

fn alloc_page(&self, size: usize) -> Result<NonNull<[u8]>, AllocError>

Returns a pointer aligned to at least 4KB

Source

unsafe fn dealloc_page(&self, page: NonNull<[u8]>)

§Safety

page has to be a currently allocated page from this instance of PageAlloc

Implementations on Foreign Types§

Source§

impl PageAlloc for Global

Source§

fn alloc_page(&self, size: usize) -> Result<NonNull<[u8]>, AllocError>

Source§

unsafe fn dealloc_page(&self, page: NonNull<[u8]>)

Implementors§