-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Enable growable array buffers #24684
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14285,23 +14285,52 @@ def test_pthread_kill(self): | |
@node_pthreads | ||
@parameterized({ | ||
'': ([], 1), | ||
'growable_arraybuffers': (['-sGROWABLE_ARRAYBUFFERS', '-Wno-experimental'], 1), | ||
'proxy': (['-sPROXY_TO_PTHREAD', '-sEXIT_RUNTIME'], 2), | ||
}) | ||
def test_pthread_growth_mainthread(self, cflags, pthread_pool_size): | ||
if '-sGROWABLE_ARRAYBUFFERS' in cflags: | ||
self.node_args.append('--experimental-wasm-rab-integration') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Worth appending to v8_args too, like we do for other experimental features? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||
self.v8_args.append('--experimental-wasm-rab-integration') | ||
self.require_node_canary() | ||
sbc100 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
else: | ||
self.cflags.append('-Wno-pthreads-mem-growth') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: I'd keep this inline in the original flags, after all if that warning shows up in "growable array buffer" mode, we also want the test to error out as it would be unexpected. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure I understand. The whole point of moving this flag so that it is not specified in "growable_arraybuffers" mode is so that if that warning ever does show up in that mode the test would error. If we unconditionally specify There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yup, my bad - I mixed up |
||
self.set_setting('PTHREAD_POOL_SIZE', pthread_pool_size) | ||
self.do_runf('pthread/test_pthread_memory_growth_mainthread.c', cflags=['-Wno-pthreads-mem-growth', '-pthread', '-sALLOW_MEMORY_GROWTH', '-sINITIAL_MEMORY=32MB', '-sMAXIMUM_MEMORY=256MB'] + cflags) | ||
self.do_runf('pthread/test_pthread_memory_growth_mainthread.c', cflags=['-pthread', '-sALLOW_MEMORY_GROWTH', '-sINITIAL_MEMORY=32MB', '-sMAXIMUM_MEMORY=256MB'] + cflags) | ||
|
||
@requires_node_canary | ||
def test_growable_arraybuffers(self): | ||
self.node_args.append('--experimental-wasm-rab-integration') | ||
self.v8_args.append('--experimental-wasm-rab-integration') | ||
self.do_runf('hello_world.c', | ||
cflags=['-O2', '-pthread', '-sALLOW_MEMORY_GROWTH', '-sGROWABLE_ARRAYBUFFERS', '-Wno-experimental'], | ||
output_basename='growable') | ||
self.do_runf('hello_world.c', | ||
cflags=['-O2', '-pthread', '-sALLOW_MEMORY_GROWTH', '-Wno-pthreads-mem-growth'], | ||
output_basename='no_growable') | ||
growable_size = os.path.getsize('growable.js') | ||
no_growable_size = os.path.getsize('no_growable.js') | ||
print('growable:', growable_size, 'no_growable:', no_growable_size) | ||
self.assertLess(growable_size, no_growable_size) | ||
|
||
# Tests memory growth in a pthread. | ||
@node_pthreads | ||
@parameterized({ | ||
'': ([],), | ||
'growable_arraybuffers': (['-sGROWABLE_ARRAYBUFFERS', '-Wno-experimental'],), | ||
'assert': (['-sASSERTIONS'],), | ||
'proxy': (['-sPROXY_TO_PTHREAD', '-sEXIT_RUNTIME'], 2), | ||
'minimal': (['-sMINIMAL_RUNTIME', '-sMODULARIZE', '-sEXPORT_NAME=MyModule'],), | ||
}) | ||
def test_pthread_growth(self, cflags, pthread_pool_size = 1): | ||
self.set_setting('PTHREAD_POOL_SIZE', pthread_pool_size) | ||
self.do_runf('pthread/test_pthread_memory_growth.c', cflags=['-Wno-pthreads-mem-growth', '-pthread', '-sALLOW_MEMORY_GROWTH', '-sINITIAL_MEMORY=32MB', '-sMAXIMUM_MEMORY=256MB'] + cflags) | ||
if '-sGROWABLE_ARRAYBUFFERS' in cflags: | ||
self.node_args.append('--experimental-wasm-rab-integration') | ||
self.v8_args.append('--experimental-wasm-rab-integration') | ||
self.require_node_canary() | ||
else: | ||
self.cflags.append('-Wno-pthreads-mem-growth') | ||
self.do_runf('pthread/test_pthread_memory_growth.c', cflags=['-pthread', '-sALLOW_MEMORY_GROWTH', '-sINITIAL_MEMORY=32MB', '-sMAXIMUM_MEMORY=256MB'] + cflags) | ||
|
||
@node_pthreads | ||
def test_emscripten_set_interval(self): | ||
|
Uh oh!
There was an error while loading. Please reload this page.