You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BridgeJS: Add opt-in TypedArray bridging for numeric arrays
Add typedArrayBridging config option ('always'/'never', default 'never')
and per-declaration @js(typedArray: true) override that bridges Swift
numeric arrays as JavaScript TypedArrays instead of Array<number>.
When enabled, [UInt8] becomes Uint8Array, [Float] becomes Float32Array,
[Double] becomes Float64Array, etc. Non-numeric arrays are unaffected.
Swift->JS direction uses bulk memory copy via memory.buffer.slice().
Uses .slice() (copy) instead of a zero-copy view because TypedArray
views into memory.buffer are invalidated when WASM memory grows.
JS->Swift direction falls back to element-by-element stack protocol.
- Add TypedArrayKind enum and BridgeType.typedArray case
- Add typedArrayBridging config to BridgeJSConfig
- Add @js(typedArray:) per-declaration override parameter
- Add _BridgeJSTypedArrayElement protocol and intrinsics
- Generate TypedArray construction in JS glue code
- Add UInt8 array benchmarks
- Update Documentation.docc for new config and type mapping
0 commit comments