We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6864e53 commit 56fc4e1Copy full SHA for 56fc4e1
Include/object.h
@@ -758,6 +758,7 @@ static inline Py_ALWAYS_INLINE void Py_INCREF(PyObject *op)
758
uint32_t local = _Py_atomic_load_uint32_relaxed(&op->ob_ref_local);
759
uint32_t new_local = local + 1;
760
if (new_local == 0) {
761
+ // local is equal to _Py_IMMORTAL_REFCNT: do nothing
762
return;
763
}
764
if (_Py_IsOwnedByCurrentThread(op)) {
@@ -771,6 +772,8 @@ static inline Py_ALWAYS_INLINE void Py_INCREF(PyObject *op)
771
772
PY_UINT32_T cur_refcnt = op->ob_refcnt_split[PY_BIG_ENDIAN];
773
PY_UINT32_T new_refcnt = cur_refcnt + 1;
774
if (new_refcnt == 0) {
775
+ // cur_refcnt is equal to _Py_IMMORTAL_REFCNT: the object is immortal,
776
+ // do nothing
777
778
779
op->ob_refcnt_split[PY_BIG_ENDIAN] = new_refcnt;
0 commit comments