The live byte view of the wasm heap (re-read after growth).
A DataView over the wasm heap, for offset-based struct reads.
Re-bind the cached heap views if a wasm call grew (and thus detached) the heap.
Reserve at least bytes of scratch and return its current base pointer.
Encode text as UTF-8 into scratch; returns its base pointer and byte length.
Encode several strings into one reserved region; returns each one's pointer and length.
Encode text as UTF-8 into scratch with a trailing NUL (for C-string arguments).
Decode length UTF-8 bytes of scratch at base into a string.
Copy length bytes of the heap at base out into a fresh Uint8Array.
The SDK's one shared marshalling region. Every transient value crossing the wasm boundary — a UTF-8 string being passed in, an info struct being read back, a block of bytes — reuses this buffer instead of allocating per call, so the ergonomic wrapper surface costs no GC on the hot path.
The engine's reserve call grows the buffer in place and returns its current base pointer. Because
ALLOW_MEMORY_GROWTHcan detach and replace the heap'sArrayBufferon any allocation, Scratch.sync re-reads the heap views after every reserve, and callers must not hold a returned pointer or view across a further reserve.