File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -93,7 +93,8 @@ typedef struct _typeobject PyTypeObject;
93
93
/* The GC bit-shifts refcounts left by two, and after that shift we still
94
94
* need this to be >> 0, so leave three high zero bits (the sign bit and
95
95
* room for a shift of two.) */
96
- #define _Py_IMMORTAL_BIT (1LL << (8 * sizeof(Py_ssize_t) - 4))
96
+ #define _Py_IMMORTAL_BIT_OFFSET (8 * sizeof(Py_ssize_t) - 4)
97
+ #define _Py_IMMORTAL_BIT (1LL << _Py_IMMORTAL_BIT_OFFSET)
97
98
98
99
#endif /* Py_IMMORTAL_OBJECTS */
99
100
@@ -551,11 +552,10 @@ static inline void _Py_INCREF(PyObject *op)
551
552
_Py_RefTotal ++ ;
552
553
#endif
553
554
#ifdef Py_IMMORTAL_OBJECTS
554
- if (_Py_IsImmortal (op )) {
555
- return ;
556
- }
557
- #endif /* Py_IMMORTAL_OBJECTS */
555
+ op -> ob_refcnt += !(op -> ob_refcnt >> _Py_IMMORTAL_BIT_OFFSET );
556
+ #else
558
557
op -> ob_refcnt ++ ;
558
+ #endif /* Py_IMMORTAL_OBJECTS */
559
559
#endif
560
560
}
561
561
#define Py_INCREF (op ) _Py_INCREF(_PyObject_CAST(op))
You can’t perform that action at this time.
0 commit comments