Re: Moving large data between JS & wasm with IDL binder

2020-07-15 Thread キャロウ マーク
> On Jul 14, 2020, at 12:00, Beuc wrote: > >> >> XMLHttpRequest most definitely supports receiving responses into >> ArrayBuffers. You set responseType=‘arrayBuffer’. However now I look more >> closely at the API there doesn’t seem to be any way to provide it with the >> destination

Re: Moving large data between JS & wasm with IDL binder

2020-07-14 Thread Beuc
Hi, On 14/07/2020 18:49, キャロウ マーク wrote: > > >> On Jul 14, 2020, at 8:37, 'Sam Clegg' via emscripten-discuss >> > > wrote: >> >> >> >> On Mon, Jul 13, 2020 at 6:43 PM キャロウ マーク > > wrote: >> >> Is is possible to use a typed

Re: Moving large data between JS & wasm with IDL binder

2020-07-14 Thread キャロウ マーク
> On Jul 14, 2020, at 8:37, 'Sam Clegg' via emscripten-discuss > wrote: > > > > On Mon, Jul 13, 2020 at 6:43 PM キャロウ マーク > wrote: > Is is possible to use a typed array created on HEAP8 with XMLHttpRequest as > the destination for the incoming data? > > > I don't

Re: Moving large data between JS & wasm with IDL binder

2020-07-14 Thread 'Sam Clegg' via emscripten-discuss
On Mon, Jul 13, 2020 at 6:43 PM キャロウ マーク wrote: > Is is possible to use a typed array created on HEAP8 with XMLHttpRequest > as the destination for the incoming data? > > I don't think so no. IIRC XMLHttpRequest API pre-dates the typed array APIs. Regards > > -Mark > > On Jul 9, 2020, at

Re: Moving large data between JS & wasm with IDL binder

2020-07-13 Thread キャロウ マーク
Is is possible to use a typed array created on HEAP8 with XMLHttpRequest as the destination for the incoming data? Regards -Mark > On Jul 9, 2020, at 9:44, Alon Zakai wrote: > > HEAP8 is one of the global variables the emscripten JS always has. It's > always present for code in a JS

Re: Moving large data between JS & wasm with IDL binder

2020-07-09 Thread Alon Zakai
HEAP8 is one of the global variables the emscripten JS always has. It's always present for code in a JS library, --pre-js, or other code that is part of the main JS output (that is all optimized together). On Wed, Jul 8, 2020 at 6:39 PM キャロウ マーク wrote: > Thanks Alon. > > > On Jul 8, 2020, at

Re: Moving large data between JS & wasm with IDL binder

2020-07-08 Thread キャロウ マーク
Thanks Alon. > On Jul 8, 2020, at 15:59, Alon Zakai wrote: > > Embind and the WebIDL binder are separate tools. They don't have any special > support for mixing between them. That’s what I had concluded. Thanks for confirming. My confusion arose because it is not clear (to me at least) that

Re: Moving large data between JS & wasm with IDL binder

2020-07-08 Thread Alon Zakai
Embind and the WebIDL binder are separate tools. They don't have any special support for mixing between them. The WebIDL binder doesn't have direct support for copying data from JS into wasm. You can do it manually though, without the WebIDL binder, by malloc()ing some room, copying the data (all

Moving large data between JS & wasm with IDL binder

2020-07-08 Thread キャロウ マーク
Can anyone here explain, or point me at an example, of how to move large data, e.g an image, between JS memory and wasm memory using a function defined with WebIDL binder? In embind for moving data from JS to wasm, I use an emscripten::val parameter to pass in the JS handle then