what you might get instead is returning a pointer to some array; which is an integer, then using that integer to get a uint8array from the U8HEAP variable, using the integer as the starting offset, and whatever length you expect...
all pointers to the heap in C/C++ are really just offsets... On Thu, Jul 21, 2022 at 5:04 PM Lorenzo Portillo <[email protected]> wrote: > Someone has an example of how to implement a C++ function called from JS > with cwrap, whose return type is a Uint8Array? > > -- > 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 [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/emscripten-discuss/068d37a5-d7d8-41fb-8e9b-88f44d33d022n%40googlegroups.com > <https://groups.google.com/d/msgid/emscripten-discuss/068d37a5-d7d8-41fb-8e9b-88f44d33d022n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/CAA2GJqWwiJamY6C4r-J2fRodkBXVAwFvTMnkSVNfEYLCGm2Rcg%40mail.gmail.com.
