summaryrefslogtreecommitdiffstats
path: root/contrib/tools/python3/Include/cpython
diff options
context:
space:
mode:
authorshadchin <[email protected]>2024-04-28 21:17:44 +0300
committershadchin <[email protected]>2024-04-28 21:25:54 +0300
commita55d99a3eb72f90355bc146baeda18aa7eb97352 (patch)
treeb17cfed786effe8b81bba022239d6729f716fbeb /contrib/tools/python3/Include/cpython
parent67bf49d08acf1277eff4c336021ac22d964bb4c4 (diff)
Update Python 3 to 3.12.3
7d09de7d8b99ea2be554ef0fc61276942ca9c2e1
Diffstat (limited to 'contrib/tools/python3/Include/cpython')
-rw-r--r--contrib/tools/python3/Include/cpython/code.h2
-rw-r--r--contrib/tools/python3/Include/cpython/longintrepr.h3
-rw-r--r--contrib/tools/python3/Include/cpython/pystate.h20
3 files changed, 19 insertions, 6 deletions
diff --git a/contrib/tools/python3/Include/cpython/code.h b/contrib/tools/python3/Include/cpython/code.h
index 03834b20c3e..311cffec113 100644
--- a/contrib/tools/python3/Include/cpython/code.h
+++ b/contrib/tools/python3/Include/cpython/code.h
@@ -75,7 +75,7 @@ typedef struct {
PyObject *_co_freevars;
} _PyCoCached;
-/* Ancilliary data structure used for instrumentation.
+/* Ancillary data structure used for instrumentation.
Line instrumentation creates an array of
these. One entry per code unit.*/
typedef struct {
diff --git a/contrib/tools/python3/Include/cpython/longintrepr.h b/contrib/tools/python3/Include/cpython/longintrepr.h
index 692c69ba76d..78ac79a7cb8 100644
--- a/contrib/tools/python3/Include/cpython/longintrepr.h
+++ b/contrib/tools/python3/Include/cpython/longintrepr.h
@@ -116,9 +116,10 @@ _PyLong_IsCompact(const PyLongObject* op) {
static inline Py_ssize_t
_PyLong_CompactValue(const PyLongObject *op)
{
+ Py_ssize_t sign;
assert(PyType_HasFeature((op)->ob_base.ob_type, Py_TPFLAGS_LONG_SUBCLASS));
assert(PyUnstable_Long_IsCompact(op));
- Py_ssize_t sign = 1 - (op->long_value.lv_tag & _PyLong_SIGN_MASK);
+ sign = 1 - (op->long_value.lv_tag & _PyLong_SIGN_MASK);
return sign * (Py_ssize_t)op->long_value.ob_digit[0];
}
diff --git a/contrib/tools/python3/Include/cpython/pystate.h b/contrib/tools/python3/Include/cpython/pystate.h
index 628f2e0996e..32789e17bda 100644
--- a/contrib/tools/python3/Include/cpython/pystate.h
+++ b/contrib/tools/python3/Include/cpython/pystate.h
@@ -251,13 +251,25 @@ 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
+#ifdef Py_DEBUG
+# if defined(__wasi__)
+# define C_RECURSION_LIMIT 150
# else
- // This value is duplicated in Lib/test/support/__init__.py
# define C_RECURSION_LIMIT 1500
# endif
+#else
+# if defined(__wasi__)
+# define C_RECURSION_LIMIT 500
+# elif defined(__s390x__)
+# define C_RECURSION_LIMIT 800
+# elif defined(_WIN32)
+# define C_RECURSION_LIMIT 3000
+# elif defined(_Py_ADDRESS_SANITIZER)
+# define C_RECURSION_LIMIT 4000
+# else
+ // This value is duplicated in Lib/test/support/__init__.py
+# define C_RECURSION_LIMIT 10000
+# endif
#endif
/* other API */