Skip to main content

Vmm

Trait Vmm 

Source
pub trait Vmm {
    // Required methods
    fn allocate_contiguous(&self, len: usize) -> Result<RawPage, AllocError>;
    fn allocate_contiguous_at(
        &self,
        at: RawPage,
        len: usize,
    ) -> Result<RawPage, AllocError>;
    fn deallocate_contiguous(&self, base: RawPage, len: usize);
}
Available on crate feature full only.
Expand description

A virtual memory allocator.

Required Methods§

Source

fn allocate_contiguous(&self, len: usize) -> Result<RawPage, AllocError>

Allocates count number of contiguous pages.

§Errors

Returns an AllocError if the memory could not be allocated. This does not mean there is no free memory, just that is there no region of contiguous memory large enough.

Source

fn allocate_contiguous_at( &self, at: RawPage, len: usize, ) -> Result<RawPage, AllocError>

Allocates count number of contiguous pages with the first frame being at at.

§Errors

Returns an AllocError if the memory could not be allocated. This does not mean there is no free memory, just that is there no region of contiguous memory large enough starting at at.

Source

fn deallocate_contiguous(&self, base: RawPage, len: usize)

Deallocates count frames starting at base.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§