]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-131238: Remove many includes from pycore_interp.h (#131472)
authorVictor Stinner <vstinner@python.org>
Wed, 19 Mar 2025 17:46:24 +0000 (18:46 +0100)
committerGitHub <noreply@github.com>
Wed, 19 Mar 2025 17:46:24 +0000 (17:46 +0000)
12 files changed:
Include/internal/pycore_interp.h
Include/internal/pycore_runtime_init.h
Objects/abstract.c
Objects/exceptions.c
Objects/object.c
Objects/tupleobject.c
Objects/unicodeobject.c
Python/ceval.c
Python/gc.c
Python/gc_free_threading.c
Python/instrumentation.c
Python/pystate.c

index 740b0c7ec46093092e721fb71887d3eb2bedee3d..28ec42377ad8cc3eaf619861947a086049ce3404 100644 (file)
@@ -11,32 +11,12 @@ extern "C" {
 #include <stdbool.h>              // bool
 
 #include "pycore_runtime_structs.h"
-#include "pycore_ceval_state.h"   // struct _ceval_state
 #include "pycore_code.h"          // struct callable_cache
-#include "pycore_codecs.h"        // struct codecs_state
-#include "pycore_context.h"       // struct _Py_context_state
-#include "pycore_crossinterp.h"   // _PyXI_state_t
-#include "pycore_dict_state.h"    // struct _Py_dict_state
-#include "pycore_dtoa.h"          // struct _dtoa_state
-#include "pycore_exceptions.h"    // struct _Py_exc_state
 #include "pycore_floatobject.h"   // struct _Py_float_state
-#include "pycore_function.h"      // FUNC_MAX_WATCHERS
 #include "pycore_gc.h"            // struct _gc_runtime_state
 #include "pycore_genobject.h"     // _PyGen_FetchStopIterationValue
-#include "pycore_global_objects.h"// struct _Py_interp_cached_objects
 #include "pycore_import.h"        // struct _import_state
-#include "pycore_index_pool.h"     // _PyIndexPool
-#include "pycore_instruments.h"   // _PY_MONITORING_EVENTS
-#include "pycore_list.h"          // struct _Py_list_state
-#include "pycore_mimalloc.h"      // struct _mimalloc_interp_state
-#include "pycore_object_state.h"  // struct _py_object_state
 #include "pycore_optimizer.h"     // _PyExecutorObject
-#include "pycore_obmalloc.h"      // struct _obmalloc_state
-#include "pycore_qsbr.h"          // struct _qsbr_state
-#include "pycore_stackref.h"      // Py_STACKREF_DEBUG
-#include "pycore_tstate.h"        // _PyThreadStateImpl
-#include "pycore_tuple.h"         // struct _Py_tuple_state
-#include "pycore_uniqueid.h"      // struct _Py_unique_id_pool
 #include "pycore_typeobject.h"    // struct types_state
 #include "pycore_unicodeobject.h" // struct _Py_unicode_state
 #include "pycore_warnings.h"      // struct _warnings_runtime_state
index 5ea9b296feba7540717cfcce302a27bc630d5bd0..497599f6717e76aa6525d4034c7cd39bb42bcfe9 100644 (file)
@@ -11,6 +11,7 @@ extern "C" {
 #include "pycore_structs.h"
 #include "pycore_ceval_state.h"   // _PyEval_RUNTIME_PERF_INIT
 #include "pycore_debug_offsets.h"  // _Py_DebugOffsets_INIT()
+#include "pycore_dtoa.h"          // _dtoa_state_INIT()
 #include "pycore_faulthandler.h"  // _faulthandler_runtime_state_INIT
 #include "pycore_floatobject.h"   // _py_float_format_unknown
 #include "pycore_function.h"
index db7b9263711f684fedc0430b95fb1eb792396b9e..ce006777e5c1dd124ebef43b735eec4b84e24340 100644 (file)
@@ -2,14 +2,16 @@
 
 #include "Python.h"
 #include "pycore_abstract.h"      // _PyIndex_Check()
-#include "pycore_pybuffer.h"
 #include "pycore_call.h"          // _PyObject_CallNoArgs()
 #include "pycore_ceval.h"         // _Py_EnterRecursiveCallTstate()
 #include "pycore_crossinterp.h"   // _Py_CallInInterpreter()
-#include "pycore_object.h"        // _Py_CheckSlotResult()
+#include "pycore_list.h"          // _PyList_AppendTakeRef()
 #include "pycore_long.h"          // _Py_IsNegative
+#include "pycore_object.h"        // _Py_CheckSlotResult()
+#include "pycore_pybuffer.h"
 #include "pycore_pyerrors.h"      // _PyErr_Occurred()
 #include "pycore_pystate.h"       // _PyThreadState_GET()
+#include "pycore_tuple.h"         // _PyTuple_FromArraySteal()
 #include "pycore_unionobject.h"   // _PyUnion_Check()
 
 #include <stddef.h>               // offsetof()
index e30fea0f37a925731f9bfd4f9b51616da5f5f072..942b0c630e33f035b7963954015736f39b93697e 100644 (file)
 #include "pycore_modsupport.h"    // _PyArg_NoKeywords()
 #include "pycore_object.h"
 #include "pycore_pyerrors.h"      // struct _PyErr_SetRaisedException
+#include "pycore_tuple.h"         // _PyTuple_FromArray()
 
 #include "osdefs.h"               // SEP
-
 #include "clinic/exceptions.c.h"
 
+
 /*[clinic input]
 class BaseException "PyBaseExceptionObject *" "&PyExc_BaseException"
 class BaseExceptionGroup "PyBaseExceptionGroupObject *" "&PyExc_BaseExceptionGroup"
index c8f3831d6f3b82695956c38701df9e1481843d82..4eff24bc3a95071012a2e1d466edfc23f41bae9e 100644 (file)
 #include "pycore_dict.h"          // _PyObject_MakeDictFromInstanceAttributes()
 #include "pycore_floatobject.h"   // _PyFloat_DebugMallocStats()
 #include "pycore_freelist.h"      // _PyObject_ClearFreeLists()
+#include "pycore_hamt.h"          // _PyHamtItems_Type
+#include "pycore_hashtable.h"     // _Py_hashtable_new()
 #include "pycore_initconfig.h"    // _PyStatus_EXCEPTION()
 #include "pycore_instruction_sequence.h" // _PyInstructionSequence_Type
-#include "pycore_hashtable.h"     // _Py_hashtable_new()
-#include "pycore_hamt.h"          // _PyHamtItems_Type
+#include "pycore_list.h"          // _PyList_DebugMallocStats()
+#include "pycore_long.h"          // _PyLong_GetZero()
 #include "pycore_memoryobject.h"  // _PyManagedBuffer_Type
 #include "pycore_namespace.h"     // _PyNamespace_Type
 #include "pycore_object.h"        // PyAPI_DATA() _Py_SwappedOp definition
 #include "pycore_object_state.h"  // struct _reftracer_runtime_state
-#include "pycore_long.h"          // _PyLong_GetZero()
 #include "pycore_optimizer.h"     // _PyUOpExecutor_Type, ...
 #include "pycore_pyerrors.h"      // _PyErr_Occurred()
 #include "pycore_pymem.h"         // _PyMem_IsPtrFreed()
 #include "pycore_pystate.h"       // _PyThreadState_GET()
 #include "pycore_symtable.h"      // PySTEntry_Type
+#include "pycore_tuple.h"         // _PyTuple_DebugMallocStats()
 #include "pycore_typeobject.h"    // _PyBufferWrapper_Type
 #include "pycore_typevarobject.h" // _PyTypeAlias_Type, _Py_initialize_generic
 #include "pycore_unionobject.h"   // _PyUnion_Type
index 1b2b53646da6d9de96796bb5778ea19ee1bb8d8a..ede8fd219c4cf018040b6a9c4a6d89ad65daa2b7 100644 (file)
@@ -7,8 +7,10 @@
 #include "pycore_freelist.h"      // _Py_FREELIST_PUSH(), _Py_FREELIST_POP()
 #include "pycore_gc.h"            // _PyObject_GC_IS_TRACKED()
 #include "pycore_initconfig.h"    // _PyStatus_OK()
+#include "pycore_list.h"          // _Py_memory_repeat()
 #include "pycore_modsupport.h"    // _PyArg_NoKwnames()
 #include "pycore_object.h"        // _PyObject_GC_TRACK(), _Py_FatalRefcountError(), _PyDebugAllocatorStats()
+#include "pycore_tuple.h"         // _PyTupleIterObject
 
 /*[clinic input]
 class tuple "PyTupleObject *" "&PyTuple_Type"
index 7a8ac322197b0ea73c51c1fe8ec364d1fd03e63b..3e0bd90c17995f6c20dae40f009a7151adeae5af 100644 (file)
@@ -56,6 +56,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 #include "pycore_pyhash.h"        // _Py_HashSecret_t
 #include "pycore_pylifecycle.h"   // _Py_SetFileSystemEncoding()
 #include "pycore_pystate.h"       // _PyInterpreterState_GET()
+#include "pycore_tuple.h"         // _PyTuple_FromArray()
 #include "pycore_ucnhash.h"       // _PyUnicode_Name_CAPI
 #include "pycore_unicodeobject.h" // struct _Py_unicode_state
 #include "pycore_unicodeobject_generated.h"  // _PyUnicode_InitStaticStrings()
index 1720fff104030d95a201ed66eeb3cc8383968be3..7248e0bbc0e1bd21c1ac8e13a0fcd4c13d952165 100644 (file)
@@ -15,6 +15,7 @@
 #include "pycore_instruments.h"
 #include "pycore_intrinsics.h"
 #include "pycore_jit.h"
+#include "pycore_list.h"          // _PyList_GetItemRef()
 #include "pycore_long.h"          // _PyLong_GetZero()
 #include "pycore_moduleobject.h"  // PyModuleObject
 #include "pycore_object.h"        // _PyObject_GC_TRACK()
index f2a88657e8d8d618eac0d7737f7ed395822bb68b..ff0fa636bd68f84c209cefd3954affed7bc798a7 100644 (file)
@@ -12,7 +12,9 @@
 #include "pycore_object_alloc.h"  // _PyObject_MallocWithType()
 #include "pycore_pyerrors.h"
 #include "pycore_pystate.h"       // _PyThreadState_GET()
+#include "pycore_tuple.h"         // _PyTuple_MaybeUntrack()
 #include "pycore_weakref.h"       // _PyWeakref_ClearRef()
+
 #include "pydtrace.h"
 
 #ifndef Py_GIL_DISABLED
index 36b6eca1eddfb3dc26c7f58fa11c3be5e0e0d2eb..713a48744df3a18e9ce0357a437064c2cda027f0 100644 (file)
@@ -10,6 +10,7 @@
 #include "pycore_object_alloc.h"  // _PyObject_MallocWithType()
 #include "pycore_pystate.h"       // _PyThreadState_GET()
 #include "pycore_tstate.h"        // _PyThreadStateImpl
+#include "pycore_tuple.h"         // _PyTuple_MaybeUntrack()
 #include "pycore_weakref.h"       // _PyWeakref_ClearRef()
 
 #include "pydtrace.h"
index 299066d9c206b6742df646073e5a132bb65d096b..56035d6ae5a5981c1784094c8c8433323a489243 100644 (file)
@@ -1,7 +1,4 @@
 #include "Python.h"
-
-#include "opcode_ids.h"
-
 #include "pycore_bitutils.h"      // _Py_popcount32
 #include "pycore_call.h"
 #include "pycore_ceval.h"         // _PY_EVAL_EVENTS_BITS
 #include "pycore_pyatomic_ft_wrappers.h" // FT_ATOMIC_STORE_UINTPTR_RELEASE
 #include "pycore_pyerrors.h"
 #include "pycore_pystate.h"       // _PyInterpreterState_GET()
-#include "pycore_runtime_structs.h"     // _PyCoMonitoringData
+#include "pycore_runtime_structs.h"  // _PyCoMonitoringData
+#include "pycore_tuple.h"         // _PyTuple_FromArraySteal()
+
+#include "opcode_ids.h"
+
 
 /* Uncomment this to dump debugging output when assertions fail */
 // #define INSTRUMENT_DEBUG 1
index 68a7426a2601d371b182b30efe747d6a15262844..3aec10219b038242772a1cd2fff012b6b9466747 100644 (file)
@@ -8,6 +8,7 @@
 #include "pycore_audit.h"         // _Py_AuditHookEntry
 #include "pycore_ceval.h"
 #include "pycore_code.h"          // stats
+#include "pycore_codecs.h"        // _PyCodec_Fini()
 #include "pycore_critical_section.h"       // _PyCriticalSection_Resume()
 #include "pycore_dtoa.h"          // _dtoa_state_INIT()
 #include "pycore_emscripten_trampoline.h"  // _Py_EmscriptenTrampoline_Init()