Struct ckb_vm::memory::sparse::SparseMemory
source · 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.
Trait Implementations§
source§impl<R: Register> Memory for SparseMemory<R>
impl<R: Register> Memory for SparseMemory<R>
type REG = R
fn new() -> Self
fn new_with_memory(memory_size: usize) -> Self
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 memory_size(&self) -> usize
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 load_bytes(&mut self, addr: u64, size: u64) -> Result<Bytes, 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>
fn lr(&self) -> &Self::REG
fn set_lr(&mut self, value: &Self::REG)
fn memory_pages(&self) -> usize
Auto Trait Implementations§
impl<R> Freeze for SparseMemory<R>where
R: Freeze,
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§
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