Skip to content

Commit b1e2a33

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

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
@@ -287,7 +287,7 @@ static inline Py_ALWAYS_INLINE void Py_INCREF(PyObject *op)
287287
}
288288
#elif SIZEOF_VOID_P > 4
289289
PY_UINT32_T cur_refcnt = op->ob_refcnt;
290-
if (((int32_t)cur_refcnt) < 0) {
290+
if (cur_refcnt >= _Py_IMMORTAL_INITIAL_REFCNT) < 0) {
291291
// the object is immortal
292292
_Py_INCREF_IMMORTAL_STAT_INC();
293293
return;

0 commit comments

Comments
 (0)