gh-125286: Share the Main Refchain With Legacy Interpreters (gh-125709)

They used to be shared, before 3.12.  Returning to sharing them resolves a failure on Py_TRACE_REFS builds.

Co-authored-by: Petr Viktorin <encukou@gmail.com>
This commit is contained in:
Eric Snow 2024-10-23 10:10:06 -06:00 committed by GitHub
parent de0d5c6e2e
commit 6f26d496d3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 99 additions and 61 deletions

View file

@ -15444,10 +15444,6 @@ _PyUnicode_InternStatic(PyInterpreterState *interp, PyObject **p)
assert(*p);
}
#ifdef Py_TRACE_REFS
extern void _Py_NormalizeImmortalReference(PyObject *);
#endif
static void
immortalize_interned(PyObject *s)
{
@ -15463,10 +15459,6 @@ immortalize_interned(PyObject *s)
#endif
_PyUnicode_STATE(s).interned = SSTATE_INTERNED_IMMORTAL;
_Py_SetImmortal(s);
#ifdef Py_TRACE_REFS
/* Make sure the ref is associated with the right interpreter. */
_Py_NormalizeImmortalReference(s);
#endif
}
static /* non-null */ PyObject*