Function newWasmAllocator

Creates a fresh WasmAllocator backed by a function-local static arena in WASM linear memory.

WasmAllocator newWasmAllocator(ulong arenaSize = 1024 * 1024)() nothrow @nogc;

Each exported builtin should call this at entry to obtain a reset allocator handle. Because the arena is shared, only one export may be active at a time (WASM is single-threaded).

Parameters

NameDescription
arenaSize size of the backing arena in bytes (default 1 MB)

Returns

An initialised WasmAllocator ready for use.