summaryrefslogtreecommitdiffstats
path: root/Include/cpython
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2024-01-16 09:32:01 (GMT)
committerGitHub <noreply@github.com>2024-01-16 09:32:01 (GMT)
commit17b73ab99ef12f89d41acec7500a244e68b1aaa4 (patch)
treebcde8fca4dc4dae4f9ed5369a4ea23bb825f15bb /Include/cpython
parent6c502ba809ff662a5eebf8c6778dec6bd28918fb (diff)
downloadcpython-17b73ab99ef12f89d41acec7500a244e68b1aaa4.zip
cpython-17b73ab99ef12f89d41acec7500a244e68b1aaa4.tar.gz
cpython-17b73ab99ef12f89d41acec7500a244e68b1aaa4.tar.bz2
GH-113655: Lower the C recursion limit on various platforms (GH-113944)
Diffstat (limited to 'Include/cpython')
-rw-r--r--Include/cpython/pystate.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/Include/cpython/pystate.h b/Include/cpython/pystate.h
index ed7dd82..1091394 100644
--- a/Include/cpython/pystate.h
+++ b/Include/cpython/pystate.h
@@ -224,10 +224,14 @@ struct _ts {
// recursions, sometimes less. 500 is a more conservative limit.
# define Py_C_RECURSION_LIMIT 500
#elif defined(__s390x__)
-# define Py_C_RECURSION_LIMIT 1200
+# define Py_C_RECURSION_LIMIT 800
+#elif defined(_WIN32)
+# define Py_C_RECURSION_LIMIT 4000
+#elif defined(_Py_ADDRESS_SANITIZER)
+# define Py_C_RECURSION_LIMIT 4000
#else
// This value is duplicated in Lib/test/support/__init__.py
-# define Py_C_RECURSION_LIMIT 8000
+# define Py_C_RECURSION_LIMIT 10000
#endif