Re: About vanilla wasm and emcc SIDE_MODULE

2017-08-11 Thread Alon Zakai
Not sure what you are asking about Tables, though? Yes, as in that link,
you can import a table from the outside (and the dynamic linking spec has a
convention for the import name). Then you can use that table inside the
wasm module (compiled code will use it automatically) and also you can use
it on the outside in JS.

On Thu, Aug 10, 2017 at 4:41 PM, Jean Valjean  wrote:

> Thanks for your detailed answer, it's really helpful.
> For the "WebAssembly.Table" feature, I was talking about this
> https://github.com/mdn/webassembly-examples/blob/
> master/js-api-examples/table2.wat
>
>
> On Thursday, August 10, 2017 at 7:23:15 PM UTC+2, Alon Zakai wrote:
>>
>> Global destructors aren't called for you, and so far the dynamic library
>> spec (which is the basis for current side module support) doesn't have a
>> feature for that. So you'd need to do that manually.
>>
>> There are some differences between how asm2wasm and the wasm backend
>> (vanilla llvm) allocate the stack. The wasm backend path is not stable yet
>> so you might be seeing a bug there, but also I think that side modules
>> haven't been tested with the wasm backend yet. I'd use the default compiler
>> path (asm2wasm) until the wasm backend is stable.
>>
>> Not sure what you're asking about Table. Your compiled c++ code should
>> use it automatically.
>>
>> On Wed, Aug 9, 2017 at 9:27 PM, Jean Valjean  wrote:
>>
>>> Also, do you recommend the use of emscripten for "vanilla wasm" output
>>> or should I stick with the original LLVM distrib ?
>>>
>>> --
>>> 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.
>>>
>>
>> --
> 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.
>

-- 
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.


Re: OpenCV and complex objects in webworkers

2017-08-11 Thread Alon Zakai
Yes, objects like that won't automatically work properly with
emscripten_call_worker. That method just receives a pointer and a size, and
it copies those bytes. In this case, the std::vector (and maybe string)
refer to bytes allocated on the heap, and not inside the object itself. So
you'd need to make sure those are copied as well.

On Fri, Aug 11, 2017 at 12:29 AM,  wrote:

> Hi,
> I am practicing to call webworker inside C++ with emscripten_call_worker()
> and I want to pass complext object, lile
> class Object
> {
> std::vector bytes;
> std::string name;
> cv::Mat image;
> }:
>
> Before passing I use memcpy to copy memory to char and pass it, but it
> looks like web worker loose some parts of bytes. When I try to get access
> to them in workers. Maybe I should add some flags, or I just cannot pass
> complex objects to worker?
>
> --
> 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.
>

-- 
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.


OpenCV and complex objects in webworkers

2017-08-11 Thread ilia . galashko
Hi,
I am practicing to call webworker inside C++ with emscripten_call_worker() 
and I want to pass complext object, lile
class Object
{
std::vector bytes;
std::string name;
cv::Mat image;
}:

Before passing I use memcpy to copy memory to char and pass it, but it 
looks like web worker loose some parts of bytes. When I try to get access 
to them in workers. Maybe I should add some flags, or I just cannot pass 
complex objects to worker?

-- 
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.