@@ -314,14 +314,17 @@ static inline Py_ALWAYS_INLINE void Py_INCREF(PyObject *op)
314314#if !defined(Py_LIMITED_API )
315315#if defined(Py_GIL_DISABLED )
316316// Implements Py_DECREF on objects not owned by the current thread.
317- PyAPI_FUNC (void ) _Py_DecRefShared (PyThreadState * , PyObject * );
318- PyAPI_FUNC (void ) _Py_DecRefSharedDebug (PyThreadState * , PyObject * , const char * , int );
317+ PyAPI_FUNC (void ) _Py_DecRefShared (PyObject * );
318+ PyAPI_FUNC (void ) _Py_DecRefSharedDebug (PyObject * , const char * , int );
319+ PyAPI_FUNC (void ) _Py_DecRefSharedTstate (PyThreadState * , PyObject * );
320+ PyAPI_FUNC (void ) _Py_DecRefSharedDebugTstate (PyThreadState * , PyObject * , const char * , int );
319321
320322// Called from Py_DECREF by the owning thread when the local refcount reaches
321323// zero. The call will deallocate the object if the shared refcount is also
322324// zero. Otherwise, the thread gives up ownership and merges the reference
323325// count fields.
324- PyAPI_FUNC (void ) _Py_MergeZeroLocalRefcount (PyThreadState * , PyObject * );
326+ PyAPI_FUNC (void ) _Py_MergeZeroLocalRefcount (PyObject * );
327+ PyAPI_FUNC (void ) _Py_MergeZeroLocalRefcountTstate (PyThreadState * , PyObject * );
325328#endif // Py_GIL_DISABLED
326329#endif // Py_LIMITED_API
327330
@@ -385,7 +388,7 @@ static inline void Py_DECREF(PyObject *op)
385388 }
386389 }
387390 else {
388- _Py_DecRefShared (_PyThreadState_GET (), op );
391+ _Py_DecRefShared (op );
389392 }
390393}
391394#define Py_DECREF (op ) Py_DECREF(_PyObject_CAST(op))
@@ -402,11 +405,11 @@ static inline void _Py_DECREF(PyThreadState *tstate, PyObject *op)
402405 local -- ;
403406 _Py_atomic_store_uint32_relaxed (& op -> ob_ref_local , local );
404407 if (local == 0 ) {
405- _Py_MergeZeroLocalRefcount (tstate , op );
408+ _Py_MergeZeroLocalRefcountTstate (tstate , op );
406409 }
407410 }
408411 else {
409- _Py_DecRefShared (tstate , op );
412+ _Py_DecRefSharedTstate (tstate , op );
410413 }
411414}
412415
0 commit comments