You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
The included test.js demonstrates that malloc is able to allocate and release memory, but it does not make it explicit how arrays of data can be passed between C and JavaScript. I realize that I am unfamiliar with WASM and JavaScript. However, I think many developers would benefit by having a simple demo showing how to use walloc for computation.
I have provided a simple demo here. The JavaScript writes to an array, and the C code returns the sum as well as modifying the array. This seems to do what I want. However, while it works, I am not freeing the array. It would be great if you could provide a minimal demo that illustrates best practices for walloc.
Hello,
The included
test.js
demonstrates that malloc is able to allocate and release memory, but it does not make it explicit how arrays of data can be passed between C and JavaScript. I realize that I am unfamiliar with WASM and JavaScript. However, I think many developers would benefit by having a simple demo showing how to use walloc for computation.I have provided a simple demo here. The JavaScript writes to an array, and the C code returns the sum as well as modifying the array. This seems to do what I want. However, while it works, I am not freeing the array. It would be great if you could provide a minimal demo that illustrates best practices for walloc.
Here is my demo running:
The text was updated successfully, but these errors were encountered: