Skip to content

remove_enlargememory - #7897

Merged
juj merged 1 commit into
emscripten-core:incomingfrom
juj:remove_enlargememory
Jan 21, 2019
Merged

juj merged 1 commit into
emscripten-core:incomingfrom
juj:remove_enlargememory

Conversation

@juj

@juj juj commented Jan 19, 2019

Copy link
Copy Markdown
Collaborator

Move enlargeMemory() and getTotalMemory() to library JS file as functions emscripten_get_heap_size() and emscripten_resize_heap(). This also changes the semantics of the old enlargeMemory() function to where one passes the new min size as a parameter (instead of setting it to DYNAMICTOP, to avoid having to back out if resizing would fail)

@juj juj added the code size label Jan 19, 2019
@juj
juj force-pushed the remove_enlargememory branch from 60b9e22 to 06c03e9 Compare January 19, 2019 15:01
@kripken

kripken commented Jan 19, 2019

Copy link
Copy Markdown
Member

What's the goal here - it's not obvious to me what the benefit or motivation is, yet?

@juj

juj commented Jan 19, 2019

Copy link
Copy Markdown
Collaborator Author

It is useful to move items out of preamble so that they are properly tracked as linkable functions. That way non-closured code and debug build code looks smaller, and if one builds with non-resizable heap, these fall out from the build even if no optimizations are performed.

The less we have specially handled items in python code like basic_funcs is, the more systematic Emscripten runtime behaves. Ideally as close to 100% as possible of Emscripten runtime would be defined in JS library functions and Emscripten would just run through to link JS library code with C++ code.

@kripken

kripken commented Jan 20, 2019

Copy link
Copy Markdown
Member

Good points, agreed. lgtm.

@juj
juj merged commit 1655d72 into emscripten-core:incoming Jan 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants