summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorThomas Wouters <thomas@python.org>2023-06-06 19:47:00 (GMT)
committerThomas Wouters <thomas@python.org>2023-06-06 19:47:00 (GMT)
commit8b895929dd3e83fc9d6ecc1d4b6b2f980d711520 (patch)
tree2be7d16f75bbbba7448e299a7d1c89fcbe08118b /Include
parent9824a28a76af4e17496443a87f341d108eb0ebbe (diff)
parente33add429f8f16340b4c186501bb1e436e66b4cc (diff)
downloadcpython-8b895929dd3e83fc9d6ecc1d4b6b2f980d711520.zip
cpython-8b895929dd3e83fc9d6ecc1d4b6b2f980d711520.tar.gz
cpython-8b895929dd3e83fc9d6ecc1d4b6b2f980d711520.tar.bz2
Merge branch '3.12' of https://github.com/python/cpython into 3.12
Diffstat (limited to 'Include')
-rw-r--r--Include/object.h22
1 files changed, 8 insertions, 14 deletions
diff --git a/Include/object.h b/Include/object.h
index c2fee85..dc5b087 100644
--- a/Include/object.h
+++ b/Include/object.h
@@ -585,20 +585,14 @@ decision that's up to the implementer of each new type so if you want,
you can count such references to the type object.)
*/
-#ifdef Py_REF_DEBUG
-# if defined(Py_LIMITED_API) && Py_LIMITED_API+0 < 0x030A0000
-extern Py_ssize_t _Py_RefTotal;
-# define _Py_INC_REFTOTAL() _Py_RefTotal++
-# define _Py_DEC_REFTOTAL() _Py_RefTotal--
-# elif !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030C0000
+#if defined(Py_REF_DEBUG) && !defined(Py_LIMITED_API)
+PyAPI_FUNC(void) _Py_NegativeRefcount(const char *filename, int lineno,
+ PyObject *op);
PyAPI_FUNC(void) _Py_IncRefTotal_DO_NOT_USE_THIS(void);
PyAPI_FUNC(void) _Py_DecRefTotal_DO_NOT_USE_THIS(void);
# define _Py_INC_REFTOTAL() _Py_IncRefTotal_DO_NOT_USE_THIS()
# define _Py_DEC_REFTOTAL() _Py_DecRefTotal_DO_NOT_USE_THIS()
-# endif
-PyAPI_FUNC(void) _Py_NegativeRefcount(const char *filename, int lineno,
- PyObject *op);
-#endif /* Py_REF_DEBUG */
+#endif // Py_REF_DEBUG && !Py_LIMITED_API
PyAPI_FUNC(void) _Py_Dealloc(PyObject *);
@@ -616,8 +610,8 @@ PyAPI_FUNC(void) _Py_DecRef(PyObject *);
static inline Py_ALWAYS_INLINE void Py_INCREF(PyObject *op)
{
-#if defined(Py_REF_DEBUG) && defined(Py_LIMITED_API) && Py_LIMITED_API+0 >= 0x030A0000
- // Stable ABI for Python 3.10 built in debug mode.
+#if defined(Py_REF_DEBUG) && defined(Py_LIMITED_API)
+ // Stable ABI for Python built in debug mode
_Py_IncRef(op);
#else
// Non-limited C API and limited C API for Python 3.9 and older access
@@ -647,8 +641,8 @@ static inline Py_ALWAYS_INLINE void Py_INCREF(PyObject *op)
# define Py_INCREF(op) Py_INCREF(_PyObject_CAST(op))
#endif
-#if defined(Py_REF_DEBUG) && defined(Py_LIMITED_API) && Py_LIMITED_API+0 >= 0x030A0000
-// Stable ABI for limited C API version 3.10 of Python debug build
+#if defined(Py_REF_DEBUG) && defined(Py_LIMITED_API)
+// Stable ABI for Python built in debug mode
static inline void Py_DECREF(PyObject *op) {
_Py_DecRef(op);
}