'Why does webassembly use fetch before using module.malloc will cause runtimeerror?

When I open -s FETCH=1 and -s EXIT_RUNTIME=1 at the same time call emscripten_fetch after using Mudole._malloc, the following error will appear.

Uncaught (in promise) RuntimeError: abort(Assertion failed: native function `malloc` called after runtime exit (use NO_EXIT_RUNTIME to keep it alive after main() exits)) at Error

That's not error when I change EXIT_RUNTIME=1 to EXIT_RUNTIME=0. Who knows why? Why can't you turn on both options at the same time.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source