Struct mmtk::util::metadata::side_metadata::global::SideMetadataContext
source · pub(crate) struct SideMetadataContext {
pub global: Vec<SideMetadataSpec>,
pub local: Vec<SideMetadataSpec>,
}
Expand description
This struct stores all the side metadata specs for a policy. Generally a policy needs to know its own side metadata spec as well as the plan’s specs.
Fields§
§global: Vec<SideMetadataSpec>
§local: Vec<SideMetadataSpec>
Implementations§
source§impl SideMetadataContext
impl SideMetadataContext
pub fn new_global_specs(specs: &[SideMetadataSpec]) -> Vec<SideMetadataSpec>
pub fn get_local_specs(&self) -> &[SideMetadataSpec]
sourcepub fn calculate_reserved_pages(&self, data_pages: usize) -> usize
pub fn calculate_reserved_pages(&self, data_pages: usize) -> usize
Return the pages reserved for side metadata based on the data pages we used.
sourcepub fn try_map_metadata_space(&self, start: Address, size: usize) -> Result<()>
pub fn try_map_metadata_space(&self, start: Address, size: usize) -> Result<()>
Tries to map the required metadata space and returns true
is successful.
This can be called at page granularity.
sourcepub fn try_map_metadata_address_range(
&self,
start: Address,
size: usize
) -> Result<()>
pub fn try_map_metadata_address_range( &self, start: Address, size: usize ) -> Result<()>
Tries to map the required metadata address range, without reserving swap-space/physical memory for it. This will make sure the address range is exclusive to the caller. This should be called at chunk granularity.
NOTE: Accessing addresses in this range will produce a segmentation fault if swap-space is not mapped using the try_map_metadata_space
function.
sourcefn map_metadata_internal(
&self,
start: Address,
size: usize,
no_reserve: bool
) -> Result<()>
fn map_metadata_internal( &self, start: Address, size: usize, no_reserve: bool ) -> Result<()>
The internal function to mmap metadata
§Arguments
start
- The starting address of the source data.size
- The size of the source data (in bytes).no_reserve
- whether to invoke mmap with a noreserve flag (we use this flag to quarantine address range)
Auto Trait Implementations§
impl RefUnwindSafe for SideMetadataContext
impl Send for SideMetadataContext
impl Sync for SideMetadataContext
impl Unpin for SideMetadataContext
impl UnwindSafe for SideMetadataContext
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more