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 {
204
204
_PyCFrame root_cframe ;
205
205
};
206
206
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
208
217
209
218
/* other API */
210
219
Original file line number Diff line number Diff line change @@ -12,16 +12,7 @@ extern "C" {
12
12
struct pyruntimestate ;
13
13
struct _ceval_runtime_state ;
14
14
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
25
16
26
17
#include "pycore_interp.h" // PyInterpreterState.eval_frame
27
18
#include "pycore_pystate.h" // _PyThreadState_GET()
You can’t perform that action at this time.
0 commit comments