-
Hello, I am using embind to export a buffer to js, and it works well, but I want to know how to do the inversed operator, how to pass a js uint8array to c++ part without copy?
|
Beta Was this translation helpful? Give feedback.
Answered by
hoodmane
Jul 8, 2025
Replies: 1 comment 2 replies
-
If the |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
hzhangxyz
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If the
Uint8Array
isn't already a view into WebAssembly memory, you'll need at least one copy if you want to have pointers into the buffer. All pointers are offsets into the WebAssembly memory. OTOH if you are okay with aread()
style interface, it's possible to avoid a copy.