diff options
Diffstat (limited to 'contrib/tools/python3/Include/cpython')
| -rw-r--r-- | contrib/tools/python3/Include/cpython/code.h | 2 | ||||
| -rw-r--r-- | contrib/tools/python3/Include/cpython/longintrepr.h | 3 | ||||
| -rw-r--r-- | contrib/tools/python3/Include/cpython/pystate.h | 20 |
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 */ |
