From 073fb132b4e7718a886341b41ccf2725cb1972af Mon Sep 17 00:00:00 2001 From: Pablo Galindo Date: Tue, 27 Jun 2023 16:40:06 +0100 Subject: [PATCH] gh-106140: Reorder some more fields to facilitate out-of-process inspection --- Include/internal/pycore_interp.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Include/internal/pycore_interp.h b/Include/internal/pycore_interp.h index 8d0bb7672690a8..466ae6fbbdc4eb 100644 --- a/Include/internal/pycore_interp.h +++ b/Include/internal/pycore_interp.h @@ -103,14 +103,19 @@ struct _is { basis. Also see _PyRuntimeState regarding the various mutex fields. */ - /* The per-interpreter GIL, which might not be used. */ - struct _gil_runtime_state _gil; - // Dictionary of the sys module PyObject *sysdict; + // Dictionary of the builtins module PyObject *builtins; + struct _ceval_state ceval; + + struct _import_state imports; + + /* The per-interpreter GIL, which might not be used. */ + struct _gil_runtime_state _gil; + /* ---------- IMPORTANT --------------------------- The fields above this line are declared as early as possible to facilitate out-of-process observability @@ -147,12 +152,8 @@ struct _is { struct _warnings_runtime_state warnings; struct atexit_state atexit; - struct _ceval_state ceval; - struct _obmalloc_state obmalloc; - struct _import_state imports; - PyObject *audit_hooks; PyType_WatchCallback type_watchers[TYPE_MAX_WATCHERS]; PyCode_WatchCallback code_watchers[CODE_MAX_WATCHERS];