From a41b29fd05eec7ef0601ea511b06ae74014da78d Mon Sep 17 00:00:00 2001
From: Pablo Galindo Salgado
Date: Tue, 27 Jun 2023 17:09:15 +0100
Subject: [PATCH] [3.12] gh-106140: Reorder some more fields to facilitate
out-of-process inspection (GH-106148) (cherry picked from commit
9126a6a9ce3772d5dc785cbee159b07a1ff7d531)
Co-authored-by: Pablo Galindo Salgado
Signed-off-by: Pablo Galindo
---
Doc/data/python3.12.abi | 190 +++++++++++++++----------------
Include/internal/pycore_interp.h | 15 +--
2 files changed, 103 insertions(+), 102 deletions(-)
diff --git a/Doc/data/python3.12.abi b/Doc/data/python3.12.abi
index 52764c1a340427e..4cd130f86e2f7e1 100644
--- a/Doc/data/python3.12.abi
+++ b/Doc/data/python3.12.abi
@@ -7570,19 +7570,19 @@
-
+
-
+
-
+
-
+
@@ -11113,7 +11113,7 @@
-
+
@@ -16004,7 +16004,7 @@
-
+
@@ -16015,7 +16015,7 @@
-
+
@@ -16072,175 +16072,175 @@
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -16257,18 +16257,18 @@
-
+
-
+
-
+
-
+
-
+
@@ -17396,8 +17396,8 @@
-
+
@@ -24923,7 +24923,7 @@
-
+
diff --git a/Include/internal/pycore_interp.h b/Include/internal/pycore_interp.h
index b12dd952556f0eb..619225c939664e7 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];