Struct parity_wasm::interpreter::MemoryInstance
[−]
[src]
pub struct MemoryInstance { /* fields omitted */ }
Linear memory instance.
Methods
impl MemoryInstance
[src]
fn new(memory_type: &MemoryType) -> Result<Arc<Self>, Error>
[src]
Create new linear memory instance.
fn limits(&self) -> &ResizableLimits
[src]
Return linear memory limits.
fn size(&self) -> u32
[src]
Return linear memory size (in pages).
fn get(&self, offset: u32, size: usize) -> Result<Vec<u8>, Error>
[src]
Get data at given offset.
fn get_into(&self, offset: u32, target: &mut [u8]) -> Result<(), Error>
[src]
Write memory slice into another slice
fn set(&self, offset: u32, value: &[u8]) -> Result<(), Error>
[src]
Set data at given offset.
fn grow(&self, pages: u32) -> Result<u32, Error>
[src]
Increases the size of the linear memory by given number of pages. Returns -1 if allocation fails or previous memory size, if succeeds.
fn copy(
&self,
src_offset: usize,
dst_offset: usize,
len: usize
) -> Result<(), Error>
[src]
&self,
src_offset: usize,
dst_offset: usize,
len: usize
) -> Result<(), Error>
Copy memory region. Semantically equivalent to memmove
.
fn copy_nonoverlapping(
&self,
src_offset: usize,
dst_offset: usize,
len: usize
) -> Result<(), Error>
[src]
&self,
src_offset: usize,
dst_offset: usize,
len: usize
) -> Result<(), Error>
Copy memory region, non-overlapping version. Semantically equivalent to memcpy
,
but returns Error if source overlaping with destination.
fn clear(&self, offset: usize, new_val: u8, len: usize) -> Result<(), Error>
[src]
Clear memory region with a specified value. Semantically equivalent to memset
.
fn zero(&self, offset: usize, len: usize) -> Result<(), Error>
[src]
Zero memory region