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
Svyatoslav Kuzmich [JB]
07/28/2023, 10:03 AM
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
jessewilson
07/28/2023, 5:04 PM
Got it. It needs something like usePinned() from Kotlin/Native