diff options
author | Victor Stinner <vstinner@python.org> | 2019-11-20 11:25:50 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-20 11:25:50 (GMT) |
commit | 7247407c35330f3f6292f1d40606b7ba6afd5700 (patch) | |
tree | fa9307b2cdbf41bf30c90daf12c76dd439949cfd /Include | |
parent | 488d02a24142948bfb1fafd19fa48e61fcbbabc5 (diff) | |
download | cpython-7247407c35330f3f6292f1d40606b7ba6afd5700.zip cpython-7247407c35330f3f6292f1d40606b7ba6afd5700.tar.gz cpython-7247407c35330f3f6292f1d40606b7ba6afd5700.tar.bz2 |
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).
Diffstat (limited to 'Include')
-rw-r--r-- | Include/internal/pycore_object.h | 2 | ||||
-rw-r--r-- | Include/internal/pycore_pymem.h | 2 | ||||
-rw-r--r-- | Include/internal/pycore_pystate.h | 7 |
3 files changed, 5 insertions, 6 deletions
diff --git a/Include/internal/pycore_object.h b/Include/internal/pycore_object.h index 4655521..ba6636d 100644 --- a/Include/internal/pycore_object.h +++ b/Include/internal/pycore_object.h @@ -38,7 +38,7 @@ static inline void _PyObject_GC_TRACK_impl(const char *filename, int lineno, filename, lineno, "_PyObject_GC_TRACK"); PyThreadState *tstate = _PyThreadState_GET(); - PyGC_Head *generation0 = tstate->interp->runtime->gc.generation0; + PyGC_Head *generation0 = tstate->interp->gc.generation0; PyGC_Head *last = (PyGC_Head*)(generation0->_gc_prev); _PyGCHead_SET_NEXT(last, gc); _PyGCHead_SET_PREV(gc, last); diff --git a/Include/internal/pycore_pymem.h b/Include/internal/pycore_pymem.h index 97d8fd9..a4e9720 100644 --- a/Include/internal/pycore_pymem.h +++ b/Include/internal/pycore_pymem.h @@ -144,7 +144,7 @@ struct _gc_runtime_state { Py_ssize_t long_lived_pending; }; -PyAPI_FUNC(void) _PyGC_InitializeRuntime(struct _gc_runtime_state *); +PyAPI_FUNC(void) _PyGC_InitState(struct _gc_runtime_state *); /* Set the memory allocator of the specified domain to the default. diff --git a/Include/internal/pycore_pystate.h b/Include/internal/pycore_pystate.h index fec64a7..0c3c1e3 100644 --- a/Include/internal/pycore_pystate.h +++ b/Include/internal/pycore_pystate.h @@ -74,6 +74,8 @@ struct _is { int finalizing; + struct _gc_runtime_state gc; + PyObject *modules; PyObject *modules_by_index; PyObject *sysdict; @@ -130,9 +132,7 @@ struct _is { struct _warnings_runtime_state warnings; PyObject *audit_hooks; -/* - * See bpo-36876: miscellaneous ad hoc statics have been moved here. - */ + struct { struct { int level; @@ -239,7 +239,6 @@ typedef struct pyruntimestate { void (*exitfuncs[NEXITFUNCS])(void); int nexitfuncs; - struct _gc_runtime_state gc; struct _ceval_runtime_state ceval; struct _gilstate_runtime_state gilstate; |