Skip to main content

PageRangeAllocator

Trait PageRangeAllocator 

Source
pub trait PageRangeAllocator {
    // Required methods
    unsafe fn init();
    fn allocate(layout: PageLayout) -> Result<PageRange, AllocError>;
    fn allocate_at(range: PageRange) -> Result<(), AllocError>;
    unsafe fn deallocate(range: PageRange);
}
Expand description

An allocator that allocates memory in page granularity.

Required Methods§

Source

unsafe fn init()

Source

fn allocate(layout: PageLayout) -> Result<PageRange, AllocError>

Attempts to allocate a range of memory in page granularity.

Source

fn allocate_at(range: PageRange) -> Result<(), AllocError>

Attempts to allocate the pages described by range.

Source

unsafe fn deallocate(range: PageRange)

Deallocates the pages described by range.

§Safety
  • range must described a range of pages currently allocated via this allocator.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§