scopedAllocCall

abstract fun <R : JsAny> scopedAllocCall(callback: () -> R): R(source)

Calls scopedAllocPush(), calls the given callback, and then calls scopedAllocPop(), propagating any exception from the callback or returning its result. This is essentially a convenience form of:

const scope = wasm.scopedAllocPush();
try { return callback() }
finally{ wasm.scopedAllocPop(scope) }