File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed
Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -12,11 +12,12 @@ extern "C" {
1212struct pyruntimestate ;
1313struct _ceval_runtime_state ;
1414
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. */
1718#ifndef Py_DEFAULT_RECURSION_LIMIT
1819# ifdef __wasi__
19- # define Py_DEFAULT_RECURSION_LIMIT 750
20+ # define Py_DEFAULT_RECURSION_LIMIT 600
2021# else
2122# define Py_DEFAULT_RECURSION_LIMIT 1000
2223# endif
Original file line number Diff line number Diff line change @@ -92,8 +92,8 @@ def test_deepcopy(self):
9292 self .assertEqual (obj_copy , expected_obj )
9393
9494 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 )
9797 recursive_array_toml = "arr = " + nest_count * "[" + nest_count * "]"
9898 tomllib .loads (recursive_array_toml )
9999
You can’t perform that action at this time.
0 commit comments