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§
unsafe fn init()
Sourcefn allocate(layout: PageLayout) -> Result<PageRange, AllocError>
fn allocate(layout: PageLayout) -> Result<PageRange, AllocError>
Attempts to allocate a range of memory in page granularity.
Sourcefn allocate_at(range: PageRange) -> Result<(), AllocError>
fn allocate_at(range: PageRange) -> Result<(), AllocError>
Attempts to allocate the pages described by range.
Sourceunsafe fn deallocate(range: PageRange)
unsafe fn deallocate(range: PageRange)
Deallocates the pages described by range.
§Safety
rangemust 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".