Skip to content

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

Merged
merged 4 commits into from
Feb 26, 2020

Conversation

kripken
Copy link
Member

@kripken kripken commented Feb 25, 2020

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.

@kripken kripken requested a review from dschuff February 25, 2020 19:23
@kripken kripken requested a review from sbc100 February 25, 2020 22:57
Copy link
Collaborator

@sbc100 sbc100 left a 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();
Copy link
Collaborator

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?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good idea!

@@ -12,15 +12,15 @@
#include <assert.h>
#include "emscripten.h"

int get_TOTAL_MEMORY() {
int get_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.

ditto

@@ -12,42 +12,42 @@
#include <assert.h>
#include "emscripten.h"

int get_TOTAL_MEMORY() {
int get_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.

ditto

@kripken kripken merged commit 52bb1ff into master Feb 26, 2020
@kripken kripken deleted the mems branch February 26, 2020 01:46
kripken added a commit that referenced this pull request Feb 26, 2020
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants