Skip to content

Commit 38865bc

Browse files
committed
Reduce default stack size from 5Mb to 1Mb
See ChangeLog.md for rationale.
1 parent 33cbb24 commit 38865bc

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

ChangeLog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ See docs/process.md for more on how version tagging works.
2020

2121
2.0.21
2222
------
23+
- Default shadow stack size used by emscripten reduced from 5Mb to 1Mb. Anyone
24+
running into issues can restore the old size using `-sTOTAL_STACK=5Mb`. Since
25+
windows has max stack of 1Mb and since WebAssembly stack usage should be less
26+
than on native platforms (since its only used for address taken values) it
27+
seems like 1Mb might still be on the high side here. For reference, llvm
28+
(`wasm-ld`) use 64kb as the default stack size.
2329
- The WebAssembly linker (`wasm-ld`) now performes string tail merging on any
2430
static string data in your program. This has long been part of the native
2531
ELF linker and should not be observable in well-behaved programs. This

src/settings.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ var MEM_INIT_METHOD = 0;
113113
// assertions are on, we will assert on not exceeding this, otherwise,
114114
// it will fail silently.
115115
// [link]
116-
var TOTAL_STACK = 5*1024*1024;
116+
var TOTAL_STACK = 1*1024*1024;
117117

118118
// What malloc()/free() to use, out of
119119
// * dlmalloc - a powerful general-purpose malloc

0 commit comments

Comments
 (0)