parseTools helpers like toIndexType and to64 #24760
-
Helpers such as I'll happily create docs, but what's the intention?
And along the same lines, what's the preference for emscripten/src/audio_worklet.js Line 122 in 5fe41a5 Some pointers here are already |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
In terms of pointers, the idea is that all pointers on the JS side are numbers. When pointers flow into JS there should always be bigint -> number conversion and then pointers flow out of JS there should be a number -> bigint conversion. There are some places that we currently cannot do that and the user ends up being exposed to bigints when running on wasm64 (IIRC EM_JS is one example).
|
Beta Was this translation helpful? Give feedback.
In terms of pointers, the idea is that all pointers on the JS side are numbers. When pointers flow into JS there should always be bigint -> number conversion and then pointers flow out of JS there should be a number -> bigint conversion.
There are some places that we currently cannot do that and the user ends up being exposed to bigints when running on wasm64 (IIRC EM_JS is one example).
toIndexType
is for interacting with the WebAssembly JS API, its will convert a value to bigint if that index type being uses is 64-bit (i.e. in wasm64 mode). Otherwise the index type is number and no conversion is done.to64
is very similar, but there is a subtle difference: it will convert also whenMEMO…