https://github.com/python/cpython/commit/67ac19111f14e9606454d0f36a52132996073db4 commit: 67ac19111f14e9606454d0f36a52132996073db4 branch: 3.13 author: Miss Islington (bot) <31488909+miss-isling...@users.noreply.github.com> committer: colesbury <colesb...@gmail.com> date: 2024-05-31T19:08:21Z summary:
[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 879d43b705faab0c59f1a6a0042e286f39f3a4ef) Co-authored-by: Sam Gross <colesb...@gmail.com> files: M Include/internal/pycore_object.h diff --git a/Include/internal/pycore_object.h b/Include/internal/pycore_object.h index 7602248f956405..f63e1da6fba025 100644 --- a/Include/internal/pycore_object.h +++ b/Include/internal/pycore_object.h @@ -497,6 +497,9 @@ _Py_NewRefWithLock(PyObject *op) if (_Py_TryIncrefFast(op)) { return op; } +#ifdef Py_REF_DEBUG + _Py_IncRefTotal(_PyThreadState_GET()); +#endif _Py_INCREF_STAT_INC(); for (;;) { Py_ssize_t shared = _Py_atomic_load_ssize_relaxed(&op->ob_ref_shared); _______________________________________________ Python-checkins mailing list -- python-checkins@python.org To unsubscribe send an email to python-checkins-le...@python.org https://mail.python.org/mailman3/lists/python-checkins.python.org/ Member address: arch...@mail-archive.com