bpo-36854: Move _PyRuntimeState.gc to PyInterpreterState (GH-17287)

* Rename _PyGC_InitializeRuntime() to _PyGC_InitState()
* finalize_interp_clear() now also calls _PyGC_Fini() in
  subinterpreters (clear the GC state).
This commit is contained in:
Victor Stinner 2019-11-20 12:25:50 +01:00 committed by GitHub
parent 488d02a241
commit 7247407c35
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 62 additions and 49 deletions

View file

@ -58,7 +58,6 @@ _PyRuntimeState_Init_impl(_PyRuntimeState *runtime)
runtime->open_code_userdata = open_code_userdata;
runtime->audit_hook_head = audit_hook_head;
_PyGC_InitializeRuntime(&runtime->gc);
_PyEval_Initialize(&runtime->ceval);
PyPreConfig_InitPythonConfig(&runtime->preconfig);
@ -208,6 +207,7 @@ PyInterpreterState_New(void)
_PyRuntimeState *runtime = &_PyRuntime;
interp->runtime = runtime;
_PyGC_InitState(&interp->gc);
PyConfig_InitPythonConfig(&interp->config);
interp->eval_frame = _PyEval_EvalFrameDefault;