From d4583125bc5819475cce9f3bd8d3b0e685775ffc Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 11 Sep 2026 10:01:58 -0700 Subject: [PATCH 1/3] work --- src/settings.js | 9 ++++++++- test/test_other.py | 2 +- tools/link.py | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/settings.js b/src/settings.js index 667a51862e4fe..1c2baded67f63 100644 --- a/src/settings.js +++ b/src/settings.js @@ -2262,11 +2262,18 @@ var JS_BASE64_API = false; // Enable support for growable views of Wasm memory. This is a recent Web // platform feature that can make growing the Wasm memory more efficient, -// especially in multi-threaded builds. +// especially in multi-threaded builds. For background, see +// https://github.com/WebAssembly/design/issues/1271 +// // Setting this to 1 will auto-detect the presence of this API and use // it when available. // Setting this to 2 will unconditionally require it. This is the only way // to completely remove the overhead of growable memory + pthreads. +// * Note that while browser support for this feature is widespread +// (https://caniuse.com/?search=sharedarraybuffer.resize), it was +// not usable on Firefox until Firefox 154, +// https://bugzilla.mozilla.org/show_bug.cgi?id=2021136 +// // This settings does nothing unless ALLOW_MEMORY_GROWTH is set. // [link] var GROWABLE_ARRAYBUFFERS = 0; diff --git a/test/test_other.py b/test/test_other.py index 0c1adaa104f75..89837e1f3909a 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -12139,7 +12139,7 @@ def test_warning_flags(self): # check that `-Wno-pthreads-mem` disables pthread + ALLOW_GROWTH_MEMORY warning stderr = self.run_process(cmd + ['-Wno-pthreads-mem-growth', '-pthread', '-sALLOW_MEMORY_GROWTH'], stderr=PIPE).stderr - self.assertNotContained('pthreads + ALLOW_MEMORY_GROWTH may run non-wasm code slowly, see https://github.com/WebAssembly/design/issues/1271', stderr) + self.assertNotContained('pthreads + ALLOW_MEMORY_GROWTH may run non-wasm code slowly, consider -sGROWABLE_ARRAYBUFFERS=2', stderr) def test_emranlib(self): create_file('foo.c', 'int foo = 1;') diff --git a/tools/link.py b/tools/link.py index c60c519f1ff0f..7f8f27f7d2ce3 100644 --- a/tools/link.py +++ b/tools/link.py @@ -461,7 +461,7 @@ def setup_pthreads(): if settings.MAIN_MODULE: diagnostics.warning('experimental', 'dynamic linking + pthreads is experimental') if settings.ALLOW_MEMORY_GROWTH and settings.GROWABLE_ARRAYBUFFERS != 2: - diagnostics.warning('pthreads-mem-growth', '-pthread + ALLOW_MEMORY_GROWTH may run non-wasm code slowly, see https://github.com/WebAssembly/design/issues/1271') + diagnostics.warning('pthreads-mem-growth', '-pthread + ALLOW_MEMORY_GROWTH may run non-wasm code slowly, consider -sGROWABLE_ARRAYBUFFERS=2') default_setting('DEFAULT_PTHREAD_STACK_SIZE', settings.STACK_SIZE) From a199f4d9024aab70e24177354e883f6e58171b75 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 11 Sep 2026 10:25:40 -0700 Subject: [PATCH 2/3] docs --- site/source/docs/tools_reference/settings_reference.rst | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/site/source/docs/tools_reference/settings_reference.rst b/site/source/docs/tools_reference/settings_reference.rst index 3decfb5b6f220..d4c331e02491a 100644 --- a/site/source/docs/tools_reference/settings_reference.rst +++ b/site/source/docs/tools_reference/settings_reference.rst @@ -3415,11 +3415,18 @@ GROWABLE_ARRAYBUFFERS Enable support for growable views of Wasm memory. This is a recent Web platform feature that can make growing the Wasm memory more efficient, -especially in multi-threaded builds. +especially in multi-threaded builds. For background, see +https://github.com/WebAssembly/design/issues/1271 + Setting this to 1 will auto-detect the presence of this API and use it when available. Setting this to 2 will unconditionally require it. This is the only way to completely remove the overhead of growable memory + pthreads. + * Note that while browser support for this feature is widespread + (https://caniuse.com/?search=sharedarraybuffer.resize), it was + not usable on Firefox until Firefox 154, + https://bugzilla.mozilla.org/show_bug.cgi?id=2021136 + This settings does nothing unless ALLOW_MEMORY_GROWTH is set. Default value: 0 From 2ae7bedadd6a30258e60d61ed6364269d5c2f464 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 11 Sep 2026 11:13:26 -0700 Subject: [PATCH 3/3] doc.format --- site/source/docs/tools_reference/settings_reference.rst | 9 +++++---- src/settings.js | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/site/source/docs/tools_reference/settings_reference.rst b/site/source/docs/tools_reference/settings_reference.rst index d4c331e02491a..97bf998e6749e 100644 --- a/site/source/docs/tools_reference/settings_reference.rst +++ b/site/source/docs/tools_reference/settings_reference.rst @@ -3422,10 +3422,11 @@ Setting this to 1 will auto-detect the presence of this API and use it when available. Setting this to 2 will unconditionally require it. This is the only way to completely remove the overhead of growable memory + pthreads. - * Note that while browser support for this feature is widespread - (https://caniuse.com/?search=sharedarraybuffer.resize), it was - not usable on Firefox until Firefox 154, - https://bugzilla.mozilla.org/show_bug.cgi?id=2021136 + +Note that while browser support for this feature is widespread +(https://caniuse.com/?search=sharedarraybuffer.resize), it was not usable on +Firefox until Firefox 154, +https://bugzilla.mozilla.org/show_bug.cgi?id=2021136 This settings does nothing unless ALLOW_MEMORY_GROWTH is set. diff --git a/src/settings.js b/src/settings.js index 1c2baded67f63..2a034b37abd1f 100644 --- a/src/settings.js +++ b/src/settings.js @@ -2269,10 +2269,11 @@ var JS_BASE64_API = false; // it when available. // Setting this to 2 will unconditionally require it. This is the only way // to completely remove the overhead of growable memory + pthreads. -// * Note that while browser support for this feature is widespread -// (https://caniuse.com/?search=sharedarraybuffer.resize), it was -// not usable on Firefox until Firefox 154, -// https://bugzilla.mozilla.org/show_bug.cgi?id=2021136 +// +// Note that while browser support for this feature is widespread +// (https://caniuse.com/?search=sharedarraybuffer.resize), it was not usable on +// Firefox until Firefox 154, +// https://bugzilla.mozilla.org/show_bug.cgi?id=2021136 // // This settings does nothing unless ALLOW_MEMORY_GROWTH is set. // [link]