8000 gh-117645: Increase WASI stack size from 512 KiB to 8 MiB · vstinner/cpython@6187587 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6187587

Browse files
committed
pythongh-117645: Increase WASI stack size from 512 KiB to 8 MiB
1 parent 5718324 commit 6187587

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

Include/cpython/pystate.h

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -198,15 +198,10 @@ struct _ts {
198198
#ifdef Py_DEBUG
199199
// A debug build is likely built with low optimization level which implies
200200
// higher stack memory usage than a release build: use a lower limit.
201-
# if defined(__wasi__)
202-
// Based on wasmtime 16.
203-
# define Py_C_RECURSION_LIMIT 150
204-
# else
205-
# define Py_C_RECURSION_LIMIT 500
206-
# endif
201+
# define Py_C_RECURSION_LIMIT 500
207202
#elif defined(__wasi__)
208203
// Based on wasmtime 16.
209-
# define Py_C_RECURSION_LIMIT 500
204+
# define Py_C_RECURSION_LIMIT 5000
210205
#elif defined(__s390x__)
211206
# define Py_C_RECURSION_LIMIT 800
212207
#elif defined(_WIN32) && defined(_M_ARM64)

configure.ac

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2359,9 +2359,9 @@ AS_CASE([$ac_sys_system],
23592359
AS_VAR_APPEND([LDFLAGS_NODIST], [" -Wl,--max-memory=10485760"])
23602360
])
23612361
2362-
dnl increase initial memory and stack size, move stack first
2362+
dnl gh-117645: increase initial memory and stack size, move stack first
23632363
dnl https://github.com/WebAssembly/wasi-libc/issues/233
2364-
AS_VAR_APPEND([LDFLAGS_NODIST], [" -z stack-size=524288 -Wl,--stack-first -Wl,--initial-memory=10485760"])
2364+
AS_VAR_APPEND([LDFLAGS_NODIST], [" -z stack-size=8388608 -Wl,--stack-first -Wl,--initial-memory=10485760"])
23652365
]
23662366
)
23672367

0 commit comments

Comments
 (0)
0