cwist
Modern C web framework with libttak runtime
Loading...
Searching...
No Matches
typedarray.h File Reference

(Deprecated) Legacy Emscripten zero-copy helpers. More...

Go to the source code of this file.

Detailed Description

(Deprecated) Legacy Emscripten zero-copy helpers.

Deprecated:
The Emscripten browser bundle has been superseded by the WASI component pipeline (issue #203). For new code, build for wasm32-wasip2 using the component pipeline. This header and its functions are retained for v4 LTS ABI compatibility.

Emscripten-only zero-copy helpers: expose C arrays and in-memory dispatch responses to JS as TypedArray views over the WASM heap, instead of round-tripping through snprintf/JSON.

This header is a deliberate no-op on native toolchains: every definition is guarded by EMSCRIPTEN, so including it from shared code is safe.

JS side, once per module:

cwist_wasm_install_views(); // C, from main() — installs:
Module.cwistView.u8(ptr, len) // -> Uint8Array view
Module.cwistView.i32(ptr, len) // -> Int32Array view
Module.cwistView.f64(ptr, len) // -> Float64Array view
size_t cap
Definition otel.c:56

Definition in file typedarray.h.