-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Rename TOTAL_MEMORY to INITIAL_MEMORY and WASM_MEM_MAX to MAXIMUM_MEMORY #10566
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love it!
}); | ||
|
||
int main() { | ||
int x = add_forty_two(100); | ||
int y = get_total_memory(); | ||
int y = get_INITIAL_MEMORY(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe leave the function name alone?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea!
tests/core/test_memorygrowth_3.c
Outdated
@@ -12,15 +12,15 @@ | |||
#include <assert.h> | |||
#include "emscripten.h" | |||
|
|||
int get_TOTAL_MEMORY() { | |||
int get_INITIAL_MEMORY() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
@@ -12,42 +12,42 @@ | |||
#include <assert.h> | |||
#include "emscripten.h" | |||
|
|||
int get_TOTAL_MEMORY() { | |||
int get_INITIAL_MEMORY() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
This is a regression from #10566 which renamed that setting to INITIAL_MEMORY, and #10449 which added a test using that setting in that way, and landed close enough that we didn't notice it was doing so. It should have worked since we tried to support the old name of the setting, but this uncovered a bug, so it's actually good that it broke! The bug is that we have special handling for expanding things like 64MB into a number, and that handling did not work on aliases. As a solution, map aliases very early in parsing.
As suggested (first half) by @dschuff . The new names are consistent with
wasm's names for them, and more accurate (as TOTAL_MEMORY wasn't
necessarily the total memory size if growth was enabled).
The old names are still supported as aliases.