mirror of
https://github.com/python/cpython.git
synced 2025-11-26 21:33:10 +00:00
gh-119799: Add missing _Py_IncRefTotal to _Py_NewRefWithLock (#119800)
The free-threaded refleak builds were reporting negative refcount deltas in some tests because of a missing `_Py_NewRefWithLock`.
This commit is contained in:
parent
9bc6045842
commit
879d43b705
1 changed files with 3 additions and 0 deletions
|
|
@ -497,6 +497,9 @@ _Py_NewRefWithLock(PyObject *op)
|
||||||
if (_Py_TryIncrefFast(op)) {
|
if (_Py_TryIncrefFast(op)) {
|
||||||
return op;
|
return op;
|
||||||
}
|
}
|
||||||
|
#ifdef Py_REF_DEBUG
|
||||||
|
_Py_IncRefTotal(_PyThreadState_GET());
|
||||||
|
#endif
|
||||||
_Py_INCREF_STAT_INC();
|
_Py_INCREF_STAT_INC();
|
||||||
for (;;) {
|
for (;;) {
|
||||||
Py_ssize_t shared = _Py_atomic_load_ssize_relaxed(&op->ob_ref_shared);
|
Py_ssize_t shared = _Py_atomic_load_ssize_relaxed(&op->ob_ref_shared);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue