pub struct ChunkStateMmapper {
transition_lock: Mutex<()>,
storage: TwoLevelStateStorage,
}
Expand description
A Mmapper
implementation based on a logical array of chunk states.
The ChunkStateMmapper::storage
field holds the state of each chunk, and the
ChunkStateMmapper
itself actually makes system calls to manage the memory mapping.
As the name suggests, this implementation of Mmapper
operates at the granularity of chunks.
Fields§
§transition_lock: Mutex<()>
Lock for transitioning map states.
storage: TwoLevelStateStorage
This holds the MapState
for each chunk.
Implementations§
Trait Implementations§
source§impl Mmapper for ChunkStateMmapper
impl Mmapper for ChunkStateMmapper
source§fn log_granularity(&self) -> u8
fn log_granularity(&self) -> u8
The logarithm of granularity of this
Mmapper
, in bytes. Must be at least
LOG_BYTES_IN_PAGE
. Read moresource§fn log_mappable_bytes(&self) -> u8
fn log_mappable_bytes(&self) -> u8
The logarithm of the address space size this
Mmapper
can handle. Read moresource§fn mark_as_mapped(&self, start: Address, bytes: usize)
fn mark_as_mapped(&self, start: Address, bytes: usize)
Mark a number of pages as mapped, without making any
request to the operating system. Used to mark pages
that the VM has already mapped. Read more
source§fn quarantine_address_range(
&self,
start: Address,
pages: usize,
strategy: MmapStrategy,
anno: &MmapAnnotation<'_>,
) -> Result<()>
fn quarantine_address_range( &self, start: Address, pages: usize, strategy: MmapStrategy, anno: &MmapAnnotation<'_>, ) -> Result<()>
Quarantine/reserve address range. We mmap from the OS with no reserve and with PROT_NONE,
which should be little overhead. This ensures that we can reserve certain address range that
we can use if needed. Quarantined memory needs to be mapped before it can be used. Read more
source§fn ensure_mapped(
&self,
start: Address,
pages: usize,
strategy: MmapStrategy,
anno: &MmapAnnotation<'_>,
) -> Result<()>
fn ensure_mapped( &self, start: Address, pages: usize, strategy: MmapStrategy, anno: &MmapAnnotation<'_>, ) -> Result<()>
Ensure that a range of pages is mmapped (or equivalent). If the
pages are not yet mapped, demand-zero map them. Note that mapping
occurs at chunk granularity, not page granularity. Read more
source§fn is_mapped_address(&self, addr: Address) -> bool
fn is_mapped_address(&self, addr: Address) -> bool
Is the page pointed to by this address mapped? Returns true if
the page at the given address is mapped. Read more
source§fn granularity(&self) -> usize
fn granularity(&self) -> usize
The granularity of
Mmapper
. Don’t override this method. Override
Mmapper::log_granularity
instead. Read moreAuto Trait Implementations§
impl !Freeze for ChunkStateMmapper
impl RefUnwindSafe for ChunkStateMmapper
impl Send for ChunkStateMmapper
impl Sync for ChunkStateMmapper
impl Unpin for ChunkStateMmapper
impl !UnwindSafe for ChunkStateMmapper
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>
Converts
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
, which can then be
downcast
into Box<dyn 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>
Converts
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
, which 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)
Converts
&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)
Converts
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§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