withWasmArena<T> function
Runs action with a scoped WasmArena over module, freeing all arena
allocations afterwards — the web analog of withArena/using.
Implementation
T withWasmArena<T>(NitroWasmModule module, T Function(WasmArena arena) action) {
final arena = WasmArena(module);
try {
return action(arena);
} finally {
arena.releaseAll();
}
}