Skip to content

Commit afab577

Browse files
committed
Further changes from code review
- Remove STACK_SIZE override, and instead use Emscripten default of 64KB - Change INITIAL_HEAP to 64KB Signed-off-by: Michael Warres <mpw@google.com>
1 parent a14a906 commit afab577

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ WASM_LIBS = $(shell $(PKG_CONFIG) $(WASM_DEPS) $(PROTO_DEPS) \
3434
EMSCRIPTEN_LINK_OPTS := --no-entry \
3535
--js-library ${PROXY_WASM_CPP_SDK}/proxy_wasm_intrinsics.js \
3636
-sSTANDALONE_WASM -sEXPORTED_FUNCTIONS=_malloc \
37-
-sALLOW_MEMORY_GROWTH=1 -sSTACK_SIZE=256KB -sINITIAL_HEAP=1MB
37+
-sALLOW_MEMORY_GROWTH=1 -sINITIAL_HEAP=64KB
3838

3939

4040
debug-deps:

bazel/defs.bzl

+2-8
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,8 @@ def proxy_wasm_cc_binary(
102102
"-sEXPORTED_FUNCTIONS=_malloc",
103103
# Allow allocating memory past initial heap size
104104
"-sALLOW_MEMORY_GROWTH=1",
105-
# Total stack size (fixed). Emscripten default stack size changed from 5MiB to 64KiB in
106-
# 3.1.27: https://github.com/emscripten-core/emscripten/blob/main/ChangeLog.md,
107-
# https://github.com/emscripten-core/emscripten/pull/18191. We pick 256KB as a balance
108-
# between reducing memory size and providing more headroom in case of deeper call
109-
# stacks. For comparison, the Rust SDK uses 1MB stack by default.
110-
"-sSTACK_SIZE=256KB",
111-
# Initial amount of heap memory
112-
"-sINITIAL_HEAP=1MB",
105+
# Initial amount of heap memory. 64KB matches Rust SDK starting heap size.
106+
"-sINITIAL_HEAP=64KB",
113107
],
114108
tags = tags + [
115109
"manual",

0 commit comments

Comments
 (0)