Struct wasmi::MemoryInstance [] [src]

pub struct MemoryInstance { /* fields omitted */ }

Runtime representation of a linear memory (or memory for short).

A memory is a contiguous, mutable array of raw bytes. Wasm code can load and store values from/to a linear memory at any byte address. A trap occurs if an access is not within the bounds of the current memory size.

A memory is created with an initial size but can be grown dynamically. The growth can be limited by specifying maximum size. The size of a memory is always a integer multiple of a page size - 64KiB.

At the moment, wasm doesn't provide any way to shrink the memory.

Methods

impl MemoryInstance
[src]

[src]

[src]

[src]

[src]

Return linear memory size (in pages).

[src]

Get data at given offset.

[src]

Write memory slice into another slice

[src]

Set data at given offset.

[src]

Increases the size of the linear memory by given number of pages. Returns previous memory size (in pages) if succeeds.

[src]

Copy memory region. Semantically equivalent to memmove.

[src]

Copy memory region, non-overlapping version. Semantically equivalent to memcpy, but returns Error if source overlaping with destination.

[src]

Clear memory region with a specified value. Semantically equivalent to memset.

[src]

Zero memory region

Trait Implementations

impl Debug for MemoryInstance
[src]

[src]

Formats the value using the given formatter.