Suppose I allocate some memory M in Javascript via Emscripten _malloc
(Javascript). Am I allowed to pass ownership of M into a marshaled C++ function that calls free
(C++) on it?
Yes. In Emscripten, the C++ version of malloc is converted to Module._malloc() in JavaScript; likewise Module._free() is the same as C++'s free().
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With