pub struct SparseMemory<R> { /* private fields */ }Expand description
A sparse flat memory implementation, it allocates pages only when requested, but besides that, it does not permission checking.
Implementations
sourceimpl<R> SparseMemory<R>
impl<R> SparseMemory<R>
Trait Implementations
sourceimpl<R> Default for SparseMemory<R>
impl<R> Default for SparseMemory<R>
sourceimpl<R: Register> Memory for SparseMemory<R>
impl<R: Register> Memory for SparseMemory<R>
type REG = R
fn init_pages(
&mut self,
addr: u64,
size: u64,
_flags: u8,
source: Option<Bytes>,
offset_from_addr: u64
) -> Result<(), Error>
fn fetch_flag(&mut self, page: u64) -> Result<u8, Error>
fn set_flag(&mut self, page: u64, flag: u8) -> Result<(), Error>
fn clear_flag(&mut self, page: u64, flag: u8) -> Result<(), Error>
fn load8(&mut self, addr: &Self::REG) -> Result<Self::REG, Error>
fn load16(&mut self, addr: &Self::REG) -> Result<Self::REG, Error>
fn load32(&mut self, addr: &Self::REG) -> Result<Self::REG, Error>
fn load64(&mut self, addr: &Self::REG) -> Result<Self::REG, Error>
fn execute_load16(&mut self, addr: u64) -> Result<u16, Error>
fn execute_load32(&mut self, addr: u64) -> Result<u32, Error>
fn store_bytes(&mut self, addr: u64, value: &[u8]) -> Result<(), Error>
fn store_byte(&mut self, addr: u64, size: u64, value: u8) -> Result<(), Error>
fn store8(&mut self, addr: &Self::REG, value: &Self::REG) -> Result<(), Error>
fn store16(&mut self, addr: &Self::REG, value: &Self::REG) -> Result<(), Error>
fn store32(&mut self, addr: &Self::REG, value: &Self::REG) -> Result<(), Error>
fn store64(&mut self, addr: &Self::REG, value: &Self::REG) -> Result<(), Error>
Auto Trait Implementations
impl<R> RefUnwindSafe for SparseMemory<R> where
R: RefUnwindSafe,
impl<R> Send for SparseMemory<R> where
R: Send,
impl<R> Sync for SparseMemory<R> where
R: Sync,
impl<R> Unpin for SparseMemory<R> where
R: Unpin,
impl<R> UnwindSafe for SparseMemory<R> where
R: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more