Skip to content

Commit 490cf8d

Browse files
committed
Add some tolerance to no-gil immortality
1 parent 155c44b commit 490cf8d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Include/refcount.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ static inline Py_ALWAYS_INLINE void Py_INCREF(PyObject *op)
294294
}
295295
op->ob_refcnt = cur_refcnt + 1;
296296
#else
297-
if (_Py_IsImmortal(op)) {
297+
if (op->ob_refcnt >= _Py_IMMORTAL_INITIAL_REFCNT) {
298298
_Py_INCREF_IMMORTAL_STAT_INC();
299299
return;
300300
}

0 commit comments

Comments
 (0)