mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
[3.13] gh-127599: Fix _Py_RefcntAdd missing calls to _Py_INCREF_STAT_INC/_Py_INCREF_IMMORTAL_STAT_INC (GH-127717) (#128713)
Previously, `_Py_RefcntAdd` hasn't called
`_Py_INCREF_STAT_INC/_Py_INCREF_IMMORTAL_STAT_INC` which is incorrect.
Now it has been fixed.
(cherry picked from commit ab05beb8ce
)
This commit is contained in:
parent
430ccbc009
commit
fdac3629e9
3 changed files with 12 additions and 0 deletions
|
@ -155,6 +155,10 @@ static inline void _Py_RefcntAdd(PyObject* op, Py_ssize_t n)
|
|||
_Py_atomic_add_ssize(&op->ob_ref_shared, (n << _Py_REF_SHARED_SHIFT));
|
||||
}
|
||||
#endif
|
||||
// Although the ref count was increased by `n` (which may be greater than 1)
|
||||
// it is only a single increment (i.e. addition) operation, so only 1 refcnt
|
||||
// increment operation is counted.
|
||||
_Py_INCREF_STAT_INC();
|
||||
}
|
||||
#define _Py_RefcntAdd(op, n) _Py_RefcntAdd(_PyObject_CAST(op), n)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue