Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/runtime_init_memory.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ function initMemory() {
} else
#endif
{
#if MINIMAL_RUNTIME
var INITIAL_MEMORY = {{{ INITIAL_MEMORY }}};
#else
var INITIAL_MEMORY = {{{ makeModuleReceiveExpr('INITIAL_MEMORY', INITIAL_MEMORY) }}};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The makeModuleReceiveExpr macro already takes care of this I think.

IIRC, MINIMAL_RUNTIME sets INCOMING_MODULE_JS_API to empty by default which should make this expand to just INITIAL_MEMORY

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this does not happen by default, but testing this now, indeed if I manually set -sINCOMING_MODULE_JS_API=[], then this does happen. So that's good solution for this, closing this PR.

#endif

#if ASSERTIONS
assert(INITIAL_MEMORY >= {{{STACK_SIZE}}}, 'INITIAL_MEMORY should be larger than STACK_SIZE, was ' + INITIAL_MEMORY + '! (STACK_SIZE=' + {{{STACK_SIZE}}} + ')');
Expand Down