8000 [3.13] gh-119799: Add missing `_Py_IncRefTotal` to `_Py_NewRefWithLoc… · python/cpython@67ac191 · GitHub
[go: up one dir, main page]

Skip to content

Commit 67ac191

Browse files
[3.13] gh-119799: Add missing _Py_IncRefTotal to _Py_NewRefWithLock (GH-119800) (#119878)
The free-threaded refleak builds were reporting negative refcount deltas in some tests because of a missing `_Py_NewRefWithLock`. (cherry picked from commit 879d43b) Co-authored-by: Sam Gross <colesbury@gmail.com>
1 parent a7e81fd commit 67ac191

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Include/internal/pycore_object.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,9 @@ _Py_NewRefWithLock(PyObject *op)
497497
if (_Py_TryIncrefFast(op)) {
498498
return op;
499499
}
500+
#ifdef Py_REF_DEBUG
501+
_Py_IncRefTotal(_PyThreadState_GET());
502+
#endif
500503
_Py_INCREF_STAT_INC();
501504
for (;;) {
502505
Py_ssize_t shared = _Py_atomic_load_ssize_relaxed(&op->ob_ref_shared);

0 commit comments

Comments
 (0)
0