Open bkotsopoulossc opened 2 years ago
I think that does the same thing: https://github.com/emscripten-core/emscripten/blob/f6fa2ec09b650838bdb8cda689f28e1ce0f15788/src/embind/embind.js#L911
Regarding the "typed" part, we won't get element type unless we turn the dataview
type into a generic one.
We have code in DataView_wasm.hpp and djinni_wasm.cpp that creates a JS Uint8Array view of memory on the wasm heap:
The Uint8Array view is used regardless of the data type in C++ - whether it is
std::vector<uint8_t>
orstd::string
.Emscripten offers a dedicated API for this -
typed_memory_view
, should we be using it? Is it more reliable or performant?