File tree Expand file tree Collapse file tree 3 files changed +3
-1
lines changed Expand file tree Collapse file tree 3 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,7 @@ PyAPI_FUNC(int) _PyObject_IsFreed(PyObject *);
7474 { \
7575 .ob_ref_local = _Py_IMMORTAL_REFCNT_LOCAL, \
7676 .ob_flags = _Py_STATICALLY_ALLOCATED_FLAG, \
77+ .ob_gc_bits = _PyGC_BITS_DEFERRED, \
7778 .ob_type = (type) \
7879 }
7980#else
Original file line number Diff line number Diff line change @@ -219,7 +219,7 @@ PyStackRef_FromPyObjectNew(PyObject *obj)
219219 // Make sure we don't take an already tagged value.
220220 assert (((uintptr_t )obj & Py_TAG_BITS ) == 0 );
221221 assert (obj != NULL );
222- if (_Py_IsImmortal ( obj ) || _PyObject_HasDeferredRefcount (obj )) {
222+ if (_PyObject_HasDeferredRefcount (obj )) {
223223 return (_PyStackRef ){ .bits = (uintptr_t )obj | Py_TAG_DEFERRED };
224224 }
225225 else {
Original file line number Diff line number Diff line change @@ -2531,6 +2531,7 @@ _Py_SetImmortalUntracked(PyObject *op)
25312531 op -> ob_tid = _Py_UNOWNED_TID ;
25322532 op -> ob_ref_local = _Py_IMMORTAL_REFCNT_LOCAL ;
25332533 op -> ob_ref_shared = 0 ;
2534+ _Py_atomic_or_uint8 (& op -> ob_gc_bits , _PyGC_BITS_DEFERRED );
25342535#else
25352536 op -> ob_refcnt = _Py_IMMORTAL_INITIAL_REFCNT ;
25362537#endif
You can’t perform that action at this time.
0 commit comments