Skip to content

Commit 50e0fe3

Browse files
Address review: add comment
1 parent 7b87fac commit 50e0fe3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Objects/object.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2677,6 +2677,9 @@ _Py_SetImmortalUntracked(PyObject *op)
26772677
}
26782678
#endif
26792679
#ifdef Py_GIL_DISABLED
2680+
// We set these bits for all immortals, even static one, to simplify
2681+
// further checks on hot path. In fact, if _Py_IsImmortal(op) == 1,
2682+
// then _PyObject_HasDeferredRefcount(op) == 1.
26802683
_Py_atomic_or_uint8(&op->ob_gc_bits, _PyGC_BITS_DEFERRED);
26812684
#endif
26822685
// Check if already immortal to avoid degrading from static immortal to plain immortal

0 commit comments

Comments
 (0)