wa_embedder_memory behaviour (wa_embedder v0.1.0)

View Source

Summary

Types

ref/0

-type ref() :: term().

Callbacks

copy/4

-callback copy(ref(), Dst :: non_neg_integer(), Src :: non_neg_integer(), N :: non_neg_integer()) -> ref().

fill/4

-callback fill(ref(), Dst :: non_neg_integer(), Value :: integer(), N :: non_neg_integer()) -> ref().

grow/2

-callback grow(ref(), DeltaPages :: non_neg_integer()) -> {integer(), ref()}.

init/4

-callback init(ref(), Dst :: non_neg_integer(), Payload :: binary(), N :: non_neg_integer()) -> ref().

load/4

-callback load(ref(),
               EffectiveAddress :: non_neg_integer(),
               Width :: 1 | 2 | 4 | 8,
               Decode :: unsigned | signed | float) ->
                  integer() | float().

new/2

-callback new(MinPages :: non_neg_integer(), MaxPages :: non_neg_integer() | none) -> ref().

size/1

-callback size(ref()) -> non_neg_integer().

store/5

-callback store(ref(),
                EffectiveAddress :: non_neg_integer(),
                Width :: 1 | 2 | 4 | 8,
                Value :: number(),
                ValueType :: integer | float) ->
                   ref().

write_data/3

-callback write_data(ref(), Offset :: non_neg_integer(), Payload :: binary()) -> ref().

Functions

page_size()

validate_backend(Backend)