diff options
author | Eric Snow <ericsnowcurrently@gmail.com> | 2023-03-08 19:03:50 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-08 19:03:50 (GMT) |
commit | cbb0aa71d040022db61390380b8aebc7c04f3275 (patch) | |
tree | 9ff9e2f3141fbd5bdc2446144955722a7d63afa9 /Modules | |
parent | 11a2c6ce516b24b2435cb627742a6c4df92d411c (diff) | |
download | cpython-cbb0aa71d040022db61390380b8aebc7c04f3275.zip cpython-cbb0aa71d040022db61390380b8aebc7c04f3275.tar.gz cpython-cbb0aa71d040022db61390380b8aebc7c04f3275.tar.bz2 |
gh-102304: Consolidate Direct Usage of _Py_RefTotal (gh-102514)
This simplifies further changes to _Py_RefTotal (e.g. make it atomic or move it to PyInterpreterState).
https://github.com/python/cpython/issues/102304
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_testcapimodule.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c index 10e507d..ea67017 100644 --- a/Modules/_testcapimodule.c +++ b/Modules/_testcapimodule.c @@ -1654,15 +1654,10 @@ slot_tp_del(PyObject *self) */ { Py_ssize_t refcnt = Py_REFCNT(self); - _Py_NewReference(self); + _Py_NewReferenceNoTotal(self); Py_SET_REFCNT(self, refcnt); } assert(!PyType_IS_GC(Py_TYPE(self)) || PyObject_GC_IsTracked(self)); - /* If Py_REF_DEBUG macro is defined, _Py_NewReference() increased - _Py_RefTotal, so we need to undo that. */ -#ifdef Py_REF_DEBUG - _Py_RefTotal--; -#endif } static PyObject * |