quickjs-wasi@3.3.1
Patch Changes
-
#31
ff79f5cThanks @TooTallNate! - Host-callbackthis/argument handles are now "borrowed": exempt fromwithScope()tracking anddispose()is a no-op. Their pointers are owned by the C trampoline (which frees them after the call returns), so a scope active around guest execution — or an explicit dispose inside a callback — previously double-freed the guest values and corrupted the heap. Callbacks retain arguments past their invocation viadup(), which takes an owned reference and behaves normally. -
#34
fca5918Thanks @TooTallNate! - Calling a guest function whose host callback is not registered now throws inside the guest (catchable, or surfaced as a host exception when uncaught), as thenewEphemeralFunctionandunregisterHostCallbackdocs already promised — previously it silently returnedundefined, masking bugs like un-re-registered callbacks after a snapshot restore. -
#33
4829774Thanks @TooTallNate! -memoryLimitnow actually bounds retained memory: the runtime is created with malloc functions that use wasi-libc'smalloc_usable_size, replacing quickjs-ng's default usable-size which returns 0 on wasm32-wasi. Previously every allocation was accounted as overhead only, so retained ArrayBuffers/TypedArrays (and all other allocations) grew real memory without bound under any limit — reaching GiB under an 8 MiBmemoryLimit— andgetMemoryUsage().mallocSizestayed near zero. Workloads near their configured limit may now throw where they silently over-allocated before; raisememoryLimitto match actual usage.