op->ob_refcnt++;
_Py_INCREF_STAT_INC();
#if defined(Py_REF_DEBUG) && !defined(Py_LIMITED_API)
- _Py_INCREF_IncRefTotal();
+ if (!_Py_IsImmortal(op)) {
+ _Py_INCREF_IncRefTotal();
+ }
#endif
}
#endif
}
_Py_DECREF_STAT_INC();
assert(!_Py_IsStaticImmortal(op));
- _Py_DECREF_DecRefTotal();
+ if (!_Py_IsImmortal(op)) {
+ _Py_DECREF_DecRefTotal();
+ }
if (--op->ob_refcnt == 0) {
_Py_Dealloc(op);
}
}
_Py_DECREF_STAT_INC();
assert(!_Py_IsStaticImmortal(op));
- _Py_DECREF_DecRefTotal();
+ if (!_Py_IsImmortal(op)) {
+ _Py_DECREF_DecRefTotal();
+ }
if (--op->ob_refcnt == 0) {
destruct(op);
}