It would be nice to have a function that produces ...
# webassembly
j
It would be nice to have a function that produces a
Pointer
from a
ByteArray
. I’m unsure whether this is possible with WASM GC. Alternately it’d be nice to view a
Pointer
as a
ByteArray
.
s
It is not possible in Wasm as these live in a separate memory spaces: linear memory and GC memory. Pointers and GC references are different types in Wasm and require different read/write instructions. However, we plan to add helper functions to simplify copying data between
Pointer
memory and
ByteArray
.
j
Got it. It needs something like usePinned() from Kotlin/Native