aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Include/internal/pycore_interp_structs.h
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2025-03-20 00:32:30 +0100
committerGitHub <noreply@github.com>2025-03-19 23:32:30 +0000
commit6827c5129c5541a8608323fceda2233d542a5ec2 (patch)
tree59dccf275f31e0ca4aa968c63b65a02a88be70f8 /Include/internal/pycore_interp_structs.h
parenta7411025c5152e638b01eef0f0f5a6bf9352b46d (diff)
downloadcpython-6827c5129c5541a8608323fceda2233d542a5ec2.tar.gz
cpython-6827c5129c5541a8608323fceda2233d542a5ec2.zip
gh-131238: Move pycore_obmalloc.h include to pycore_runtime_structs.h (#131482)
Move pycore_obmalloc.h include from pycore_interp_structs.h to pycore_runtime_structs.h. Add also comment explaining the purpose of each include in pycore_interp_structs.h, pycore_runtime_structs.h and pycore_structs.h. Remove <stdbool.h> and <stddef.h> from pycore_structs.h.
Diffstat (limited to 'Include/internal/pycore_interp_structs.h')
-rw-r--r--Include/internal/pycore_interp_structs.h29
1 files changed, 10 insertions, 19 deletions
diff --git a/Include/internal/pycore_interp_structs.h b/Include/internal/pycore_interp_structs.h
index de1b41da369..ee92a1e6f2d 100644
--- a/Include/internal/pycore_interp_structs.h
+++ b/Include/internal/pycore_interp_structs.h
@@ -1,3 +1,6 @@
+/* This file contains the struct definitions for interpreter state
+ * and other necessary structs */
+
#ifndef Py_INTERNAL_INTERP_STRUCTS_H
#define Py_INTERNAL_INTERP_STRUCTS_H
#ifdef __cplusplus
@@ -12,9 +15,6 @@ extern "C" {
#include "pycore_typedefs.h" // _PyRuntimeState
-/* This file contains the struct definitions for interpreter state
- * and other necessary structs */
-
#define CODE_MAX_WATCHERS 8
#define CONTEXT_MAX_WATCHERS 8
#define FUNC_MAX_WATCHERS 8
@@ -247,13 +247,7 @@ struct _gc_runtime_state {
#endif
};
-#include "pycore_gil.h"
-
-/****** Thread state **************/
-#include "pytypedefs.h"
-#include "pystate.h"
-#include "pycore_tstate.h"
-
+#include "pycore_gil.h" // struct _gil_runtime_state
/**** Import ********/
@@ -327,8 +321,8 @@ struct _import_state {
/********** Interpreter state **************/
-#include "pycore_object_state.h"
-#include "pycore_crossinterp.h"
+#include "pycore_object_state.h" // struct _py_object_state
+#include "pycore_crossinterp.h" // _PyXI_state_t
struct _Py_long_state {
@@ -453,8 +447,8 @@ struct _py_func_state {
struct _func_version_cache_item func_version_cache[FUNC_VERSION_CACHE_SIZE];
};
-#include "pycore_dict_state.h"
-#include "pycore_exceptions.h"
+#include "pycore_dict_state.h" // struct _Py_dict_state
+#include "pycore_exceptions.h" // struct _Py_exc_state
/****** type state *********/
@@ -635,7 +629,7 @@ struct _Py_unicode_ids {
PyObject **array;
};
-#include "pycore_ucnhash.h"
+#include "pycore_ucnhash.h" // _PyUnicode_Name_CAPI
struct _Py_unicode_state {
struct _Py_unicode_fs_codec fs_codec;
@@ -654,8 +648,6 @@ struct callable_cache {
PyObject *object__getattribute__;
};
-#include "pycore_obmalloc.h"
-
/* Length of array of slotdef pointers used to store slots with the
same __name__. There should be at most MAX_EQUIV-1 slotdef entries with
the same __name__, for any __name__. Since that's a static property, it is
@@ -696,7 +688,7 @@ struct _Py_interp_static_objects {
} singletons;
};
-#include "pycore_instruments.h"
+#include "pycore_instruments.h" // PY_MONITORING_TOOL_IDS
#ifdef Py_GIL_DISABLED
@@ -955,7 +947,6 @@ struct _is {
};
-
#ifdef __cplusplus
}
#endif