We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
We have code in DataView_wasm.hpp and djinni_wasm.cpp that creates a JS Uint8Array view of memory on the wasm heap:
static auto uint8ArrayClass = em::val::global("Uint8Array"); unsigned addr = reinterpret_cast<unsigned>(buffer.data()); unsigned size = static_cast<unsigned>(buffer.size()); em::val uint8ArrayObj = uint8ArrayClass.new_(getWasmMemoryBuffer(), addr, size); return uint8ArrayObj;
The Uint8Array view is used regardless of the data type in C++ - whether it is std::vector<uint8_t> or std::string.
std::vector<uint8_t>
std::string
Emscripten offers a dedicated API for this - typed_memory_view, should we be using it? Is it more reliable or performant?
typed_memory_view
return em::val view(em::typed_memory_view(buffer.size(), buffer.data()));
The text was updated successfully, but these errors were encountered:
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.
dataview
Sorry, something went wrong.
li-feng-sc
No branches or pull requests
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?The text was updated successfully, but these errors were encountered: