@@ -2541,38 +2541,6 @@ _Py_ResurrectReference(PyObject *op)
2541
2541
2542
2542
2543
2543
#ifdef Py_TRACE_REFS
2544
- /* Make sure the ref is associated with the right interpreter.
2545
- * This only needs special attention for heap-allocated objects
2546
- * that have been immortalized, and only when the object might
2547
- * outlive the interpreter where it was created. That means the
2548
- * object was necessarily created using a global allocator
2549
- * (i.e. from the main interpreter). Thus in that specific case
2550
- * we move the object over to the main interpreter's refchain.
2551
- *
2552
- * This was added for the sake of the immortal interned strings,
2553
- * where legacy subinterpreters share the main interpreter's
2554
- * interned dict (and allocator), and therefore the strings can
2555
- * outlive the subinterpreter.
2556
- *
2557
- * It may make sense to fold this into _Py_SetImmortalUntracked(),
2558
- * but that requires further investigation. In the meantime, it is
2559
- * up to the caller to know if this is needed. There should be
2560
- * very few cases.
2561
- */
2562
- void
2563
- _Py_NormalizeImmortalReference (PyObject * op )
2564
- {
2565
- assert (_Py_IsImmortal (op ));
2566
- PyInterpreterState * interp = _PyInterpreterState_GET ();
2567
- if (!_PyRefchain_IsTraced (interp , op )) {
2568
- return ;
2569
- }
2570
- if (!has_own_refchain (interp )) {
2571
- interp = _PyInterpreterState_Main ();
2572
- }
2573
- assert (_PyRefchain_IsTraced (interp , op ));
2574
- }
2575
-
2576
2544
void
2577
2545
_Py_ForgetReference (PyObject * op )
2578
2546
{
0 commit comments