Skip to content

Fix parsing of TOTAL_MEMORY=64MB #10581

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 2 commits into from
Feb 26, 2020
Merged
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions emcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,9 @@ def standardize_setting_change(key, value):
if key.startswith('NO_') and value in ('0', '1'):
key = key[3:]
value = str(1 - int(value))
# map legacy settings which have aliases to the new names
if key in shared.Settings.legacy_settings and key in shared.Settings.alt_names:
key = shared.Settings.alt_names[key]
return key, value

for change in changes:
Expand Down
4 changes: 2 additions & 2 deletions tests/test_browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -4978,6 +4978,6 @@ def test_pthread_modularize_export_name(self):
''')
self.btest(path_from_root('tests', 'pthread', 'test_pthread_create.cpp'),
expected='0',
args=['-s', 'TOTAL_MEMORY=64MB', '-s', 'USE_PTHREADS=1', '-s',
'PTHREAD_POOL_SIZE=8', '-s', 'MODULARIZE_INSTANCE=1',
args=['-s', 'INITIAL_MEMORY=64MB', '-s', 'USE_PTHREADS=1',
'-s', 'PTHREAD_POOL_SIZE=8', '-s', 'MODULARIZE_INSTANCE=1',
'-s', 'EXPORT_NAME=MyModule', '--shell-file', 'shell.html'])
1 change: 1 addition & 0 deletions tests/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -8762,6 +8762,7 @@ def assert_aliases_match(flag1, flag2, flagarg, extra_args=[]):
self.assertEqual(results[flag1 + '.wasm'], results[flag2 + '.wasm'], 'wasm results should be identical')

assert_aliases_match('INITIAL_MEMORY', 'TOTAL_MEMORY', '16777216')
assert_aliases_match('INITIAL_MEMORY', 'TOTAL_MEMORY', '64MB')
assert_aliases_match('MAXIMUM_MEMORY', 'WASM_MEM_MAX', '16777216', ['-s', 'ALLOW_MEMORY_GROWTH'])
assert_aliases_match('MAXIMUM_MEMORY', 'BINARYEN_MEM_MAX', '16777216', ['-s', 'ALLOW_MEMORY_GROWTH'])

Expand Down