File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -2232,7 +2232,7 @@ static inline int PyUnstable_Object_IsUniquelyReferenced(PyObject *obj)
22322232#endif
22332233
22342234// gh-128926 added PyUnstable_TryIncRef() and PyUnstable_EnableTryIncRef() to
2235- // Python 3.14.0a5. Adapted from _Py_TryIncref and _PyObject_SetMaybeWeakref.
2235+ // Python 3.14.0a5. Adapted from _Py_TryIncref() and _PyObject_SetMaybeWeakref() .
22362236#if PY_VERSION_HEX < 0x030E00A5
22372237static inline int PyUnstable_TryIncRef (PyObject *op)
22382238{
@@ -2243,9 +2243,11 @@ static inline int PyUnstable_TryIncRef(PyObject *op)
22432243 }
22442244 return 0 ;
22452245#else
2246+ // _Py_TryIncrefFast()
22462247 uint32_t local = _Py_atomic_load_uint32_relaxed (&op->ob_ref_local );
22472248 local += 1 ;
22482249 if (local == 0 ) {
2250+ // immortal
22492251 return 1 ;
22502252 }
22512253 if (_Py_IsOwnedByCurrentThread (op)) {
@@ -2256,6 +2258,8 @@ static inline int PyUnstable_TryIncRef(PyObject *op)
22562258#endif
22572259 return 1 ;
22582260 }
2261+
2262+ // _Py_TryIncRefShared()
22592263 Py_ssize_t shared = _Py_atomic_load_ssize_relaxed (&op->ob_ref_shared );
22602264 for (;;) {
22612265 // If the shared refcount is zero and the object is either merged
@@ -2281,6 +2285,7 @@ static inline int PyUnstable_TryIncRef(PyObject *op)
22812285static inline void PyUnstable_EnableTryIncRef (PyObject *op)
22822286{
22832287#ifdef Py_GIL_DISABLED
2288+ // _PyObject_SetMaybeWeakref()
22842289 if (_Py_IsImmortal (op)) {
22852290 return ;
22862291 }
You can’t perform that action at this time.
0 commit comments