File tree 2 files changed +6
-5
lines changed
2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -12,11 +12,12 @@ extern "C" {
12
12
struct pyruntimestate ;
13
13
struct _ceval_runtime_state ;
14
14
15
- /* WASI has limited call stack. wasmtime 0.36 can handle sufficient amount of
16
- C stack frames for little more than 750 recursions. */
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. */
17
18
#ifndef Py_DEFAULT_RECURSION_LIMIT
18
19
# ifdef __wasi__
19
- # define Py_DEFAULT_RECURSION_LIMIT 750
20
+ # define Py_DEFAULT_RECURSION_LIMIT 600
20
21
# else
21
22
# define Py_DEFAULT_RECURSION_LIMIT 1000
22
23
# endif
Original file line number Diff line number Diff line change @@ -92,8 +92,8 @@ def test_deepcopy(self):
92
92
self .assertEqual (obj_copy , expected_obj )
93
93
94
94
def test_inline_array_recursion_limit (self ):
95
- # 470 with default recursion limit
96
- nest_count = int (sys .getrecursionlimit () * 0.47 )
95
+ # 465 with default recursion limit
96
+ nest_count = int (sys .getrecursionlimit () * 0.465 )
97
97
recursive_array_toml = "arr = " + nest_count * "[" + nest_count * "]"
98
98
tomllib .loads (recursive_array_toml )
99
99
You can’t perform that action at this time.
0 commit comments