Skip to content

Commit cde7c75

Browse files
kubkonandrewrk
authored andcommitted
Increase default Wasm stack to 1MB
This commit increases the default Wasm stack to 1MB from the default of 1 Wasm page which equal 64KB. This seems like a reasonable default size while at the same time not overly large. Also, Rust lang seems to be favouring this default as well: [rust-lang#50083]. [rust-lang#50083]: rust-lang/rust#50083
1 parent 0d40cb6 commit cde7c75

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/link.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2100,6 +2100,10 @@ static void construct_linker_job_wasm(LinkJob *lj) {
21002100
CodeGen *g = lj->codegen;
21012101

21022102
lj->args.append("-error-limit=0");
2103+
// Increase the default stack size to a more reasonable value of 1MB instead of
2104+
// the default of 1 Wasm page being 64KB.
2105+
lj->args.append("-z");
2106+
lj->args.append("stack-size=1048576");
21032107

21042108
if (g->out_type != OutTypeExe) {
21052109
lj->args.append("--no-entry"); // So lld doesn't look for _start.

0 commit comments

Comments
 (0)