This actually looks very helpful, but I wonder if there is a "cleaner
looking" way to actually "pass" an arraybuffer from js to a wasm module:
https://stackoverflow.com/questions/46861475/how-can-i-find-out-the-address-of-a-webassembly-buffer-and-return-it-to-javascri

On Sun, Oct 22, 2017 at 4:35 PM, Andrew Varga <grizzl...@gmail.com> wrote:

> Hi,
>
> I'm having a hard time achieving something that sounds easy:
> - create an ArrayBufferView instance in JavaScript eg.: new
> Uint8Array([1,2,3]
> - pass this to a function in a wasm module that will operate on it and
> change some of the values (it will not create a new array)
> - be able to access the modified array in JavaScript
>
> I'm trying to achieve this with as little glue-code as possible, my setup
> is here:
> https://github.com/andrewvarga/wasm_test
>
> When I run index.html, the console output is 29 which I believe comes from
> 23 + 6 (see buffertest.c), so I must be doing something very wrong.
>
> What I'm looking for is the simplest, smallest, fastest way to allow wasm
> module to change an array (like adding 6 to each element that I tried to do
> here).
>
> Any help would be very much appreciated!
>
> Thank you,
> Andrew
>
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "emscripten-discuss" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/emscripten-discuss/ecAgoEwK2ME/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> emscripten-discuss+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to emscripten-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to