/// Reads from stable memory back to heap.
Reads from stable memory back to heap.
Reads from stable memory back to heap .
pub(super) fn stable_read(
        &self,
        dst: u32,
        offset: u32,
        size: u32,
        heap: &mut [u8],
    ) -> HypervisorResult<()> {
        let (dst, offset, size) = (dst as usize, offset as usize, size as usize);
        if offset + size > (self.stable_size()? as usize * WASM_PAGE_SIZE_IN_BYTES as usize) {
            return Err(HypervisorError::Trapped(StableMemoryOutOfBounds));
        }
        if dst + size > heap.len() {
            return Err(HypervisorError::Trapped(HeapOutOfBounds));
        }
        self.stable_memory_buffer
            .read(&mut heap[dst..dst + size], offset);
        Ok(())
    }
pub ( super ) fn stable_read ( & self , dst : u32 , offset : u32 , size : u32 , heap : & mut [ u8 ] , ) -> HypervisorResult < ( ) > { let ( dst , offset , size ) = ( dst as usize , offset as usize , size as usize ) ; if offset + size > ( self . stable_size ( ) ? as usize * WASM_PAGE_SIZE_IN_BYTES as usize ) { return Err ( HypervisorError :: Trapped ( StableMemoryOutOfBounds ) ) ; } if dst + size > heap . len ( ) { return Err ( HypervisorError :: Trapped ( HeapOutOfBounds ) ) ; } self . stable_memory_buffer . read ( & mut heap [ dst .. dst + size ] , offset ) ; Ok ( ( ) ) }
Reads from stable memory back to heap.
Reads from stable memory back to heap .
&self
dst
u32
offset
u32
size
u32
heap
&mut [u8]