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>
Create new linear memory instance.
fn size(&self) -> u32
Return linear memory size (in pages).
fn get(&self, offset: u32, size: usize) -> Result<Vec<u8>, Error>
Get data at given offset.
fn set(&self, offset: u32, value: &[u8]) -> Result<(), Error>
Set data at given offset.
fn grow(&self, pages: u32) -> Result<u32, Error>
Increases the size of the linear memory by given number of pages. Returns -1 if allocation fails or previous memory size, if succeeds.