Can you give steps to reproduce?   Perhaps you can open an issue in the bug
tracker?

Can you tell which JS function is referencing `getMemory`?    It should
be removed from the codebase (except if `-s MAIN_MODULE`  is used).

cheers,
sam


On Sun, Sep 13, 2020 at 8:24 PM Александр Гурьянов <[email protected]>
wrote:

> Sorry I don't understand what I should do. This error happens on a
> regular codebase without something special (just libzip and extraction
> code). I use emsdk, emcmake, cmake and make to compile it. I don't
> call getMemory or dynamicAlloc from my side, I mean how can I call
> them before instantiation is finished? There is some pattern in C/C++
> code that results in this behaviour?
>
> P. S. 2.0.2 works fine.
>
> пн, 14 сент. 2020 г. в 10:16, 'Sam Clegg' via emscripten-discuss
> <[email protected]>:
> >
> > These functions were removed since we managed to remove all our
> allocations that occurred before startup.
> >
> > This is/was an important thing for us to do as it allows wasm-ld (the
> static linker) to fully determine memory layout and specifically heap
> location without the need for post-link modifications to the wasm binary.
> >
> > You should be able simply call `_malloc` instead, or move your
> allocation in a C/C++ global?   These are the two approaches that we used
> to remove all or our internal usage of dynamicAlloc.
> >
> > cheers,
> > sam
> >
> > On Sun, Sep 13, 2020 at 8:04 PM Александр Гурьянов <[email protected]>
> wrote:
> >>
> >> Hi. Just updated emscripten to 2.0.3, everything builds fine but now I
> >> have error on module instantiation:
> >>
> >> ReferenceError: getMemory is not defined
> >>
> >> I checked the generated code of Module, and it have:
> >>
> >> Module["getMemory"] = getMemory;
> >>
> >> but getMemory itself never defined, for example in previous version it
> was:
> >>
> >>             function getMemory(size) {
> >>                 if (!runtimeInitialized) return dynamicAlloc(size);
> >>                 return _malloc(size)
> >>             }
> >> Also dynamicAlloc is not there.
> >>
> >> There are some new compiler flags?
> >> 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/CAKOm%3DVG-dBKPFWGowBuV7Ah%3DA1TLR1koBPBmJhNAY3cd4TcM0Q%40mail.gmail.com
> .
> >
> > --
> > 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/CAL_va2-1kXWHTVq4XCSzpJMvFhjEae45j3sG7JvM%2BBbUCQtUBA%40mail.gmail.com
> .
>
> --
> 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/CAKOm%3DVF5o2iDfMa-qcBp53PA-z_NuMqMnyakuDFGWnUV1DzMiw%40mail.gmail.com
> .
>

-- 
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/CAL_va2__y6Bd4M-oR6VpskT%3DGdAqTcp8O1WKnf4hY6itRHz_mQ%40mail.gmail.com.

Reply via email to