mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-39573: Use Py_REFCNT() macro (GH-18388)
Replace direct acccess to PyObject.ob_refcnt with usage of the Py_REFCNT() macro.
This commit is contained in:
parent
446463f8db
commit
a93c51e3a8
9 changed files with 42 additions and 38 deletions
|
@ -1173,8 +1173,9 @@ subtype_dealloc(PyObject *self)
|
|||
}
|
||||
if (type->tp_del) {
|
||||
type->tp_del(self);
|
||||
if (self->ob_refcnt > 0)
|
||||
if (Py_REFCNT(self) > 0) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/* Find the nearest base with a different tp_dealloc */
|
||||
|
@ -1239,7 +1240,7 @@ subtype_dealloc(PyObject *self)
|
|||
if (type->tp_del) {
|
||||
_PyObject_GC_TRACK(self);
|
||||
type->tp_del(self);
|
||||
if (self->ob_refcnt > 0) {
|
||||
if (Py_REFCNT(self) > 0) {
|
||||
/* Resurrected */
|
||||
goto endlabel;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue