]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-106140: Reorder some more fields to facilitate out-of-process inspection (#106148)
authorPablo Galindo Salgado <Pablogsal@gmail.com>
Tue, 27 Jun 2023 16:09:15 +0000 (17:09 +0100)
committerGitHub <noreply@github.com>
Tue, 27 Jun 2023 16:09:15 +0000 (16:09 +0000)
Include/internal/pycore_interp.h

index 8d0bb7672690a863dde41cc3b76f886baf1060e9..466ae6fbbdc4ebd5867cdde5a9216677154be84c 100644 (file)
@@ -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];