mirror of
https://github.com/python/cpython.git
synced 2025-11-26 13:22:51 +00:00
Fix Py_INCREF() statistics in limited C API 3.10 (#96120)
In the limited C API with a debug build, Py_INCREF() is implemented by calling _Py_IncRef() which calls Py_INCREF(). Only call _Py_INCREF_STAT_INC() once.
This commit is contained in:
parent
b2714f05c5
commit
026ab6f4e5
1 changed files with 1 additions and 1 deletions
|
|
@ -511,11 +511,11 @@ PyAPI_FUNC(void) _Py_DecRef(PyObject *);
|
||||||
|
|
||||||
static inline void Py_INCREF(PyObject *op)
|
static inline void Py_INCREF(PyObject *op)
|
||||||
{
|
{
|
||||||
_Py_INCREF_STAT_INC();
|
|
||||||
#if defined(Py_REF_DEBUG) && defined(Py_LIMITED_API) && Py_LIMITED_API+0 >= 0x030A0000
|
#if defined(Py_REF_DEBUG) && defined(Py_LIMITED_API) && Py_LIMITED_API+0 >= 0x030A0000
|
||||||
// Stable ABI for Python 3.10 built in debug mode.
|
// Stable ABI for Python 3.10 built in debug mode.
|
||||||
_Py_IncRef(op);
|
_Py_IncRef(op);
|
||||||
#else
|
#else
|
||||||
|
_Py_INCREF_STAT_INC();
|
||||||
// Non-limited C API and limited C API for Python 3.9 and older access
|
// Non-limited C API and limited C API for Python 3.9 and older access
|
||||||
// directly PyObject.ob_refcnt.
|
// directly PyObject.ob_refcnt.
|
||||||
#ifdef Py_REF_DEBUG
|
#ifdef Py_REF_DEBUG
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue