pub trait VMMap: Sync {
Show 15 methods
// Required methods
fn insert(&self, start: Address, extent: usize, descriptor: SpaceDescriptor);
fn create_freelist(&self, start: Address) -> CreateFreeListResult;
fn create_parent_freelist(
&self,
start: Address,
units: usize,
grain: i32
) -> CreateFreeListResult;
unsafe fn allocate_contiguous_chunks(
&self,
descriptor: SpaceDescriptor,
chunks: usize,
head: Address,
maybe_freelist: Option<&mut dyn FreeList>
) -> Address;
fn get_next_contiguous_region(&self, start: Address) -> Address;
fn get_contiguous_region_chunks(&self, start: Address) -> usize;
fn get_contiguous_region_size(&self, start: Address) -> usize;
fn get_available_discontiguous_chunks(&self) -> usize;
fn get_chunk_consumer_count(&self) -> usize;
fn free_all_chunks(&self, any_chunk: Address);
unsafe fn free_contiguous_chunks(&self, start: Address) -> usize;
fn finalize_static_space_map(
&self,
from: Address,
to: Address,
on_discontig_start_determined: &mut dyn FnMut(Address)
);
fn is_finalized(&self) -> bool;
fn get_descriptor_for_address(&self, address: Address) -> SpaceDescriptor;
fn add_to_cumulative_committed_pages(&self, pages: usize);
}
Required Methods§
fn insert(&self, start: Address, extent: usize, descriptor: SpaceDescriptor)
sourcefn create_freelist(&self, start: Address) -> CreateFreeListResult
fn create_freelist(&self, start: Address) -> CreateFreeListResult
Create a free-list for a discontiguous space. Must only be called at boot time.
sourcefn create_parent_freelist(
&self,
start: Address,
units: usize,
grain: i32
) -> CreateFreeListResult
fn create_parent_freelist( &self, start: Address, units: usize, grain: i32 ) -> CreateFreeListResult
Create a free-list for a contiguous space. Must only be called at boot time.
sourceunsafe fn allocate_contiguous_chunks(
&self,
descriptor: SpaceDescriptor,
chunks: usize,
head: Address,
maybe_freelist: Option<&mut dyn FreeList>
) -> Address
unsafe fn allocate_contiguous_chunks( &self, descriptor: SpaceDescriptor, chunks: usize, head: Address, maybe_freelist: Option<&mut dyn FreeList> ) -> Address
§Safety
Caller must ensure that only one thread is calling this method.
fn get_next_contiguous_region(&self, start: Address) -> Address
fn get_contiguous_region_chunks(&self, start: Address) -> usize
fn get_contiguous_region_size(&self, start: Address) -> usize
sourcefn get_available_discontiguous_chunks(&self) -> usize
fn get_available_discontiguous_chunks(&self) -> usize
Return the total number of chunks available (unassigned) within the range of virtual memory apportioned to discontiguous spaces.
sourcefn get_chunk_consumer_count(&self) -> usize
fn get_chunk_consumer_count(&self) -> usize
Return the total number of clients contending for chunks. This is useful when establishing conservative bounds on the number of remaining chunks.
fn free_all_chunks(&self, any_chunk: Address)
sourceunsafe fn free_contiguous_chunks(&self, start: Address) -> usize
unsafe fn free_contiguous_chunks(&self, start: Address) -> usize
§Safety
Caller must ensure that only one thread is calling this method.
sourcefn finalize_static_space_map(
&self,
from: Address,
to: Address,
on_discontig_start_determined: &mut dyn FnMut(Address)
)
fn finalize_static_space_map( &self, from: Address, to: Address, on_discontig_start_determined: &mut dyn FnMut(Address) )
Finalize the globlal maps in the implementations of VMMap
. This should be called after
all spaces are created.
Arguments:
from
: the starting address of the heapto
: the address of the last byte within the heapon_discontig_start_determined
: Called when the address range of the discontiguous memory range is determined. Will not be called if theVMMap
implementation does not have a discontigous memory range. TheAddress
argument of the callback is the starting address of the discontiguous memory range.