Skip to content

Commit

Permalink
Increase default Wasm stack to 1MB
Browse files Browse the repository at this point in the history
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
  • Loading branch information
kubkon committed Jun 4, 2020
1 parent 6524a64 commit ace4c87
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/link.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2100,6 +2100,10 @@ static void construct_linker_job_wasm(LinkJob *lj) {
CodeGen *g = lj->codegen;

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

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

0 comments on commit ace4c87

Please sign in to comment.