Memory growth does mean you need to be careful when accessing the heap from
JavaScript. Emscripten will update the HEAPU8 etc. views, but if you held
on to references to the old views, or subarrays of them etc., those would
become invalid, and you'd silently miss updates to memory. Basically,
growth has the effect of creating replacements for all the JS memory views.

(This is even trickier with multithreaded code using memory growth.)

On Wed, May 8, 2019 at 10:34 AM Marc Fawzi <[email protected]> wrote:

> Hi,
>
> Somehow when writing a large amount of data (over the 16MB default) to the
> Module heap (HEAPU8) I saw what could be a bug when ALLOW_MEMORY_GROWTH was
> set. Basically, when I print out the content I saw Emscripten’s own
> symbols, the C++ program symbols and a bunch of binary gibberish before the
> start of the the data I had written, as if my read offset was somehow
> smaller than my write offset. I’m working with someone else’ code and
> trying to understand what’s going on but when setting the memory manually
> at build time instead of allowing it to grow the code works just write and
> I get the exact data I write back when I read it.
>
> Any guides or blog posts out there for working with the heap?
>
> Thanks,
>
> --
> 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/CACioZivWDQ4HKHu6sdHq%2B%3Dyk2WX_GsiUcanTPDyNam1cWMmcUQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/emscripten-discuss/CACioZivWDQ4HKHu6sdHq%2B%3Dyk2WX_GsiUcanTPDyNam1cWMmcUQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> 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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/emscripten-discuss/CAEX4NpSDrHS89s-NxYStqn81RLD03Pg78Ns07QMc%3DMzdQzHKAw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to