mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
GH-91079: Rename C_RECURSION_LIMIT to Py_C_RECURSION_LIMIT (#108507)
Symbols of the C API should be prefixed by "Py_" to avoid conflict with existing names in 3rd party C extensions on "#include <Python.h>". test.pythoninfo now logs Py_C_RECURSION_LIMIT constant and other _testcapi and _testinternalcapi constants.
This commit is contained in:
parent
15d4c9fabc
commit
b0edf3b98e
17 changed files with 67 additions and 39 deletions
|
@ -194,18 +194,17 @@ struct _ts {
|
|||
|
||||
};
|
||||
|
||||
/* WASI has limited call stack. Python's recursion limit depends on code
|
||||
layout, optimization, and WASI runtime. Wasmtime can handle about 700
|
||||
recursions, sometimes less. 500 is a more conservative limit. */
|
||||
#ifndef C_RECURSION_LIMIT
|
||||
# ifdef __wasi__
|
||||
# define C_RECURSION_LIMIT 500
|
||||
# else
|
||||
// This value is duplicated in Lib/test/support/__init__.py
|
||||
# define C_RECURSION_LIMIT 1500
|
||||
# endif
|
||||
#ifdef __wasi__
|
||||
// WASI has limited call stack. Python's recursion limit depends on code
|
||||
// layout, optimization, and WASI runtime. Wasmtime can handle about 700
|
||||
// recursions, sometimes less. 500 is a more conservative limit.
|
||||
# define Py_C_RECURSION_LIMIT 500
|
||||
#else
|
||||
// This value is duplicated in Lib/test/support/__init__.py
|
||||
# define Py_C_RECURSION_LIMIT 1500
|
||||
#endif
|
||||
|
||||
|
||||
/* other API */
|
||||
|
||||
/* Similar to PyThreadState_Get(), but don't issue a fatal error
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue