@@ -215,19 +215,13 @@ refchain_fini(PyInterpreterState *interp)
215
215
bool
216
216
_PyRefchain_IsTraced (PyInterpreterState * interp , PyObject * obj )
217
217
{
218
- if (!has_own_refchain (interp )) {
219
- interp = _PyInterpreterState_Main ();
220
- }
221
218
return (_Py_hashtable_get (REFCHAIN (interp ), obj ) == REFCHAIN_VALUE );
222
219
}
223
220
224
221
225
222
static void
226
223
_PyRefchain_Trace (PyInterpreterState * interp , PyObject * obj )
227
224
{
228
- if (!has_own_refchain (interp )) {
229
- interp = _PyInterpreterState_Main ();
230
- }
231
225
if (_Py_hashtable_set (REFCHAIN (interp ), obj , REFCHAIN_VALUE ) < 0 ) {
232
226
// Use a fatal error because _Py_NewReference() cannot report
233
227
// the error to the caller.
@@ -239,9 +233,6 @@ _PyRefchain_Trace(PyInterpreterState *interp, PyObject *obj)
239
233
static void
240
234
_PyRefchain_Remove (PyInterpreterState * interp , PyObject * obj )
241
235
{
242
- if (!has_own_refchain (interp )) {
243
- interp = _PyInterpreterState_Main ();
244
- }
245
236
void * value = _Py_hashtable_steal (REFCHAIN (interp ), obj );
246
237
#ifndef NDEBUG
247
238
assert (value == REFCHAIN_VALUE );
@@ -2587,9 +2578,6 @@ _Py_PrintReferences(PyInterpreterState *interp, FILE *fp)
2587
2578
interp = _PyInterpreterState_Main ();
2588
2579
}
2589
2580
fprintf (fp , "Remaining objects:\n" );
2590
- if (!has_own_refchain (interp )) {
2591
- interp = _PyInterpreterState_Main ();
2592
- }
2593
2581
_Py_hashtable_foreach (REFCHAIN (interp ), _Py_PrintReference , fp );
2594
2582
}
2595
2583
@@ -2618,9 +2606,6 @@ void
2618
2606
_Py_PrintReferenceAddresses (PyInterpreterState * interp , FILE * fp )
2619
2607
{
2620
2608
fprintf (fp , "Remaining object addresses:\n" );
2621
- if (!has_own_refchain (interp )) {
2622
- interp = _PyInterpreterState_Main ();
2623
- }
2624
2609
_Py_hashtable_foreach (REFCHAIN (interp ), _Py_PrintReferenceAddress , fp );
2625
2610
}
2626
2611
@@ -2700,9 +2685,6 @@ _Py_GetObjects(PyObject *self, PyObject *args)
2700
2685
.limit = limit ,
2701
2686
};
2702
2687
PyInterpreterState * interp = _PyInterpreterState_GET ();
2703
- if (!has_own_refchain (interp )) {
2704
- interp = _PyInterpreterState_Main ();
2705
- }
2706
2688
int res = _Py_hashtable_foreach (REFCHAIN (interp ), _Py_GetObject , & data );
2707
2689
if (res == _PY_GETOBJECTS_ERROR ) {
2708
2690
Py_DECREF (list );
0 commit comments