Skip to content

Commit 9126a6a

Browse files
authored
pythongh-106140: Reorder some more fields to facilitate out-of-process inspection (python#106148)
1 parent 2d5a1c2 commit 9126a6a

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

Include/internal/pycore_interp.h

+8-7
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,19 @@ struct _is {
103103
basis. Also see _PyRuntimeState regarding the various mutex fields.
104104
*/
105105

106-
/* The per-interpreter GIL, which might not be used. */
107-
struct _gil_runtime_state _gil;
108-
109106
// Dictionary of the sys module
110107
PyObject *sysdict;
108+
111109
// Dictionary of the builtins module
112110
PyObject *builtins;
113111

112+
struct _ceval_state ceval;
113+
114+
struct _import_state imports;
115+
116+
/* The per-interpreter GIL, which might not be used. */
117+
struct _gil_runtime_state _gil;
118+
114119
/* ---------- IMPORTANT ---------------------------
115120
The fields above this line are declared as early as
116121
possible to facilitate out-of-process observability
@@ -147,12 +152,8 @@ struct _is {
147152
struct _warnings_runtime_state warnings;
148153
struct atexit_state atexit;
149154

150-
struct _ceval_state ceval;
151-
152155
struct _obmalloc_state obmalloc;
153156

154-
struct _import_state imports;
155-
156157
PyObject *audit_hooks;
157158
PyType_WatchCallback type_watchers[TYPE_MAX_WATCHERS];
158159
PyCode_WatchCallback code_watchers[CODE_MAX_WATCHERS];

0 commit comments

Comments
 (0)