We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1479821 commit 7371bacCopy full SHA for 7371bac
Include/refcount.h
@@ -307,7 +307,10 @@ static inline Py_ALWAYS_INLINE void Py_INCREF(PyObject *op)
307
#endif
308
_Py_INCREF_STAT_INC();
309
#ifdef Py_REF_DEBUG
310
- _Py_INCREF_IncRefTotal();
+ // Don't count the incref if the object is immortal.
311
+ if (_Py_IsImmortal(op)) {
312
+ _Py_INCREF_IncRefTotal();
313
+ }
314
315
316
}
0 commit comments