gh-131238: Remove includes from pycore_interp.h (#131495) · python/cpython@b69da00

GitHub

GitHub CopilotWrite better code with AI | MCP RegistryIntegrate external tools | ActionsAutomate any workflow | CodespacesInstant dev environments | IssuesPlan and track work | Code ReviewManage code changes | Code QualityEnforce quality at merge | Why GitHub | Marketplace | View all features | Enterprises | Small and medium teams | Startups | View all use cases | View all industries | View all solutions | AI | Software Development | DevOps | Security | View all topics | Customer stories | Events & webinars | Ebooks & reports | Business insights | Trust center | Partners | View all resources

Original file line numberDiff line numberDiff line change@@ -8,9 +8,8 @@ extern "C" {

88# error "this header requires Py_BUILD_CORE define"

99#endif

101011-#include"pycore_structs.h"// _Py_CODEUNIT

12-#include"pycore_stackref.h"// _PyStackRef

1311#include"pycore_backoff.h"// _Py_BackoffCounter

12+#include"pycore_structs.h"// _Py_CODEUNIT

1413#include"pycore_tstate.h"// _PyThreadStateImpl

15141615Original file line numberDiff line numberDiff line change@@ -9,7 +9,8 @@ extern "C" {

99#endif

10101111#include"pycore_freelist_state.h"// struct _Py_freelists

12-#include"pycore_object.h"// _PyObject_IS_GC

12+#include"pycore_interp_structs.h"// PyInterpreterState

13+#include"pycore_pyatomic_ft_wrappers.h"// FT_ATOMIC_STORE_PTR_RELAXED()

1314#include"pycore_pystate.h"// _PyThreadState_GET

1415#include"pycore_stats.h"// OBJECT_STAT_INC

1516Original file line numberDiff line numberDiff line change@@ -8,7 +8,7 @@ extern "C" {

88# error "this header requires Py_BUILD_CORE define"

99#endif

101011-#include"pycore_genobject.h"// _PyGen_FetchStopIterationValue

11+#include"pycore_interp_structs.h"// PyInterpreterState

121213131414/* interpreter state */

@@ -27,7 +27,6 @@ extern "C" {

27272828externvoid_PyInterpreterState_Clear(PyThreadState*tstate);

292930-3130staticinlinePyThreadState*

3231_PyInterpreterState_GetFinalizing(PyInterpreterState*interp) {

3332return (PyThreadState*)_Py_atomic_load_ptr_relaxed(&interp->_finalizing);

@@ -53,7 +52,6 @@ _PyInterpreterState_SetFinalizing(PyInterpreterState *interp, PyThreadState *tst

5352}

5453555456-5755// Exports for the _testinternalcapi module.

5856PyAPI_FUNC(int64_t) _PyInterpreterState_ObjectToID(PyObject*);

5957PyAPI_FUNC(PyInterpreterState*) _PyInterpreterState_LookUpID(int64_t);

Original file line numberDiff line numberDiff line change@@ -6,16 +6,14 @@

66#endif

7788#include"Python.h"

9-#include"pycore_abstract.h"// _PyIndex_Check()

9+#include"pycore_code.h"// _PyCode_HAS_EXECUTORS()

1010#include"pycore_crossinterp.h"// _PyXIData_t

1111#include"pycore_interp.h"// _PyInterpreterState_IDIncref()

12-#include"pycore_initconfig.h"// _PyErr_SetFromPyStatus()

1312#include"pycore_modsupport.h"// _PyArg_BadArgument()

1413#include"pycore_namespace.h"// _PyNamespace_New()

1514#include"pycore_pybuffer.h"// _PyBuffer_ReleaseInInterpreterAndRawFree()

16-#include"pycore_pyerrors.h"// _Py_excinfo

1715#include"pycore_pylifecycle.h"// _PyInterpreterConfig_AsDict()

18-#include"pycore_pystate.h"// _PyInterpreterState_SetRunningMain()

16+#include"pycore_pystate.h"// _PyInterpreterState_IsRunningMain()

19172018#include"marshal.h"// PyMarshal_ReadObjectFromString()

2119Original file line numberDiff line numberDiff line change@@ -7,6 +7,7 @@

77#include"pycore_ceval.h"// _PyEval_SetProfile()

88#include"pycore_pystate.h"// _PyThreadState_GET()

99#include"pycore_time.h"// _PyTime_FromLong()

10+#include"pycore_typeobject.h"// _PyType_GetModuleState()

1011#include"pycore_unicodeobject.h"// _PyUnicode_EqualToASCIIString()

11121213#include"rotatingtree.h"

Original file line numberDiff line numberDiff line change@@ -6,9 +6,9 @@

66#include"clinic/watchers.c.h"

7788#definePy_BUILD_CORE

9-#include"pycore_function.h"// FUNC_MAX_WATCHERS

10-#include"pycore_code.h"// CODE_MAX_WATCHERS

11-#include"pycore_context.h"// CONTEXT_MAX_WATCHERS

9+#include"pycore_function.h"// FUNC_MAX_WATCHERS

10+#include"pycore_interp_structs.h"// CODE_MAX_WATCHERS

11+#include"pycore_context.h"// CONTEXT_MAX_WATCHERS

12121313/*[clinic input]

1414module _testcapi

Original file line numberDiff line numberDiff line change@@ -17,7 +17,7 @@

1717#include"pycore_code.h"// _PyCode_GetTLBCFast()

1818#include"pycore_compile.h"// _PyCompile_CodeGen()

1919#include"pycore_context.h"// _PyContext_NewHamtForTests()

20-#include"pycore_dict.h"// _PyManagedDictPointer_GetValues()

20+#include"pycore_dict.h"// PyDictValues

2121#include"pycore_fileutils.h"// _Py_normpath()

2222#include"pycore_flowgraph.h"// _PyCompile_OptimizeCfg()

2323#include"pycore_frame.h"// _PyInterpreterFrame

@@ -26,11 +26,11 @@

2626#include"pycore_import.h"// _PyImport_ClearExtension()

2727#include"pycore_initconfig.h"// _Py_GetConfigsAsDict()

2828#include"pycore_instruction_sequence.h"// _PyInstructionSequence_New()

29+#include"pycore_interpframe.h"// _PyFrame_GetFunction()

2930#include"pycore_object.h"// _PyObject_IsFreed()

30-#include"pycore_optimizer.h"// JitOptSymbol, etc.

3131#include"pycore_pathconfig.h"// _PyPathConfig_ClearGlobal()

3232#include"pycore_pyerrors.h"// _PyErr_ChainExceptions1()

33-#include"pycore_pylifecycle.h"// _PyInterpreterConfig_AsDict()

33+#include"pycore_pylifecycle.h"// _PyInterpreterConfig_InitFromDict()

3434#include"pycore_pystate.h"// _PyThreadState_GET()

3535#include"pycore_unicodeobject.h"// _PyUnicode_TransformDecimalAndSpaceToASCII()

3636Original file line numberDiff line numberDiff line change@@ -8,7 +8,7 @@

88#include"pycore_ceval.h"// _PyEval_SignalReceived()

99#include"pycore_emscripten_signal.h"// _Py_CHECK_EMSCRIPTEN_SIGNALS

1010#include"pycore_fileutils.h"// _Py_BEGIN_SUPPRESS_IPH

11-#include"pycore_frame.h"// _PyInterpreterFrame

11+#include"pycore_interpframe.h"// _PyThreadState_GetFrame()

1212#include"pycore_moduleobject.h"// _PyModule_GetState()

1313#include"pycore_pyerrors.h"// _PyErr_SetString()

1414#include"pycore_pystate.h"// _PyThreadState_GET()

Original file line numberDiff line numberDiff line change@@ -5,10 +5,11 @@

55#include"pycore_call.h"// _PyObject_CallNoArgs()

66#include"pycore_ceval.h"// _Py_EnterRecursiveCallTstate()

77#include"pycore_crossinterp.h"// _Py_CallInInterpreter()

8+#include"pycore_genobject.h"// _PyGen_FetchStopIterationValue()

89#include"pycore_list.h"// _PyList_AppendTakeRef()

9-#include"pycore_long.h"// _Py_IsNegative

10+#include"pycore_long.h"// _PyLong_IsNegative()

1011#include"pycore_object.h"// _Py_CheckSlotResult()

11-#include"pycore_pybuffer.h"

12+#include"pycore_pybuffer.h"// _PyBuffer_ReleaseInInterpreterAndRawFree()

1213#include"pycore_pyerrors.h"// _PyErr_Occurred()

1314#include"pycore_pystate.h"// _PyThreadState_GET()

1415#include"pycore_tuple.h"// _PyTuple_FromArraySteal()

Original file line numberDiff line numberDiff line change@@ -2,16 +2,14 @@

22#include"opcode.h"

3344#include"pycore_code.h"// _PyCodeConstructor

5-#include"pycore_frame.h"// FRAME_SPECIALS_SIZE

65#include"pycore_hashtable.h"// _Py_hashtable_t

7-#include"pycore_index_pool.h"// _PyIndexPool

6+#include"pycore_index_pool.h"// _PyIndexPool_Fini()

87#include"pycore_initconfig.h"// _PyStatus_OK()

98#include"pycore_interp.h"// PyInterpreterState.co_extra_freefuncs

10-#include"pycore_object.h"// _PyObject_SetDeferredRefcount

11-#include"pycore_object_stack.h"

12-#include"pycore_opcode_metadata.h"// _PyOpcode_Deopt, _PyOpcode_Caches

9+#include"pycore_interpframe.h"// FRAME_SPECIALS_SIZE

10+#include"pycore_opcode_metadata.h"// _PyOpcode_Caches

1311#include"pycore_opcode_utils.h"// RESUME_AT_FUNC_START

14-#include"pycore_pymem.h"// _PyMem_FreeDelayed

12+#include"pycore_pymem.h"// _PyMem_FreeDelayed()

1513#include"pycore_pystate.h"// _PyInterpreterState_GET()

1614#include"pycore_setobject.h"// _PySet_NextEntry()

1715#include"pycore_tuple.h"// _PyTuple_ITEMS()