mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
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:
parent
de0d5c6e2e
commit
6f26d496d3
7 changed files with 99 additions and 61 deletions
|
@ -674,6 +674,13 @@ pycore_create_interpreter(_PyRuntimeState *runtime,
|
|||
return status;
|
||||
}
|
||||
|
||||
// This could be done in init_interpreter() (in pystate.c) if it
|
||||
// didn't depend on interp->feature_flags being set already.
|
||||
status = _PyObject_InitState(interp);
|
||||
if (_PyStatus_EXCEPTION(status)) {
|
||||
return status;
|
||||
}
|
||||
|
||||
// initialize the interp->obmalloc state. This must be done after
|
||||
// the settings are loaded (so that feature_flags are set) but before
|
||||
// any calls are made to obmalloc functions.
|
||||
|
@ -2297,6 +2304,13 @@ new_interpreter(PyThreadState **tstate_p,
|
|||
goto error;
|
||||
}
|
||||
|
||||
// This could be done in init_interpreter() (in pystate.c) if it
|
||||
// didn't depend on interp->feature_flags being set already.
|
||||
status = _PyObject_InitState(interp);
|
||||
if (_PyStatus_EXCEPTION(status)) {
|
||||
return status;
|
||||
}
|
||||
|
||||
// initialize the interp->obmalloc state. This must be done after
|
||||
// the settings are loaded (so that feature_flags are set) but before
|
||||
// any calls are made to obmalloc functions.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue