File tree Expand file tree Collapse file tree 2 files changed +11
-11
lines changed
Expand file tree Collapse file tree 2 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -204,7 +204,16 @@ struct _ts {
204204 _PyCFrame root_cframe ;
205205};
206206
207- #define C_RECURSION_LIMIT 800
207+ /* WASI has limited call stack. Python's recursion limit depends on code
208+ layout, optimization, and WASI runtime. Wasmtime can handle about 700
209+ recursions, sometimes less. 500 is a more conservative limit. */
210+ #ifndef Py_DEFAULT_RECURSION_LIMIT
211+ # ifdef __wasi__
212+ # define C_RECURSION_LIMIT 500
213+ # else
214+ # define C_RECURSION_LIMIT 800
215+ # endif
216+ #endif
208217
209218/* other API */
210219
Original file line number Diff line number Diff line change @@ -12,16 +12,7 @@ extern "C" {
1212struct pyruntimestate ;
1313struct _ceval_runtime_state ;
1414
15- /* WASI has limited call stack. Python's recursion limit depends on code
16- layout, optimization, and WASI runtime. Wasmtime can handle about 700-750
17- recursions, sometimes less. 600 is a more conservative limit. */
18- #ifndef Py_DEFAULT_RECURSION_LIMIT
19- # ifdef __wasi__
20- # define Py_DEFAULT_RECURSION_LIMIT 600
21- # else
22- # define Py_DEFAULT_RECURSION_LIMIT 1000
23- # endif
24- #endif
15+ #define Py_DEFAULT_RECURSION_LIMIT 1000
2516
2617#include "pycore_interp.h" // PyInterpreterState.eval_frame
2718#include "pycore_pystate.h" // _PyThreadState_GET()
You can’t perform that action at this time.
0 commit comments