allocChunks

abstract fun allocChunks(n: Int, sz: Int): ReadonlyArray<WasmPointer>(source)
abstract fun allocChunks(n: Int, sz: String): ReadonlyArray<WasmPointer>(source)

alloc()'s n chunks, each sz bytes, as a single memory block and returns the addresses as an array of n element, each holding the address of one chunk.

The sz argument may be a string value accepted by wasm.sizeofIR(), and any string value not accepted by that function will trigger a WasmAllocError exception.

Throws a WasmAllocError if allocation fails.

Example:

const [p1, p2, p3] = pstack.allocChunks(3,4);