]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-131238: Remove pycore_object_deferred.h from pycore_object.h (#131549)
authorVictor Stinner <vstinner@python.org>
Fri, 21 Mar 2025 16:44:10 +0000 (17:44 +0100)
committerGitHub <noreply@github.com>
Fri, 21 Mar 2025 16:44:10 +0000 (16:44 +0000)
Remove also pycore_function.h from pycore_typeobject.h.

Include/internal/pycore_interpframe.h
Include/internal/pycore_object.h
Include/internal/pycore_stackref.h
Include/internal/pycore_typeobject.h
Modules/_threadmodule.c
Objects/codeobject.c
Objects/descrobject.c
Objects/funcobject.c
Objects/moduleobject.c
Objects/obmalloc.c

index 93d3469ce75ec3297e489307cd8864d5fca08eee..f513dbe5cbbdb30d966120f92efe8b701a59c3b5 100644 (file)
@@ -10,8 +10,9 @@
 #endif
 
 #include "pycore_code.h"          // _PyCode_CODE()
-#include "pycore_structs.h"       // _PyStackRef
 #include "pycore_stackref.h"      // PyStackRef_AsPyObjectBorrow()
+#include "pycore_stats.h"         // CALL_STAT_INC()
+#include "pycore_structs.h"       // _PyStackRef
 #include "pycore_typedefs.h"      // _PyInterpreterFrame
 
 
index 30b88404bbe2049be3fe316942d73a9ca141617f..5e900f5bb91c99563edc924e187ae40d032e2168 100644 (file)
@@ -8,15 +8,17 @@ extern "C" {
 #  error "this header requires Py_BUILD_CORE define"
 #endif
 
-#include <stdbool.h>
 #include "pycore_emscripten_trampoline.h" // _PyCFunction_TrampolineCall()
-#include "pycore_object_deferred.h" // _PyObject_HasDeferredRefcount
-#include "pycore_pyatomic_ft_wrappers.h"  // FT_ATOMIC_STORE_PTR_RELAXED
+#include "pycore_gc.h"            // _PyObject_GC_TRACK()
+#include "pycore_pyatomic_ft_wrappers.h" // FT_ATOMIC_LOAD_PTR_ACQUIRE()
 #include "pycore_pystate.h"       // _PyInterpreterState_GET()
 #include "pycore_runtime.h"       // _PyRuntime
 #include "pycore_typeobject.h"    // _PyStaticType_GetState()
 #include "pycore_uniqueid.h"      // _PyObject_ThreadIncrefSlow()
 
+#include <stdbool.h>              // bool
+
+
 // This value is added to `ob_ref_shared` for objects that use deferred
 // reference counting so that they are not immediately deallocated when the
 // non-deferred reference count drops to zero.
index 9a9ec4be5b6ebf57eae3789d20b1f4733b53847a..cf7688416b170b4832546d2abd20606277775623 100644 (file)
@@ -13,11 +13,11 @@ extern "C" {
 #  error "this header requires Py_BUILD_CORE define"
 #endif
 
-#include "pycore_object_deferred.h"
-#include "pycore_object.h"
+#include "pycore_object.h"        // Py_DECREF_MORTAL
+#include "pycore_object_deferred.h" // _PyObject_HasDeferredRefcount()
+
+#include <stdbool.h>              // bool
 
-#include <stddef.h>
-#include <stdbool.h>
 
 /*
   This file introduces a new API for handling references on the stack, called
index cd36400c0d3e956b95d6dcea79cf0d695091cc0c..1a4f89fd2449a05ecfb7fae7902695889e4f6443 100644 (file)
@@ -8,10 +8,8 @@ extern "C" {
 #  error "this header requires Py_BUILD_CORE define"
 #endif
 
-#include "pycore_function.h"
 #include "pycore_interp_structs.h" // managed_static_type_state
 #include "pycore_moduleobject.h"  // PyModuleObject
-#include "pycore_stats.h"
 
 
 /* state */
index 53b2e685a577db11738ae4bbdfeb4a9143602e9a..bcac2b48f18457be0a2374b58675546209c6d36e 100644 (file)
@@ -5,8 +5,9 @@
 #include "pycore_fileutils.h"     // _PyFile_Flush
 #include "pycore_interp.h"        // _PyInterpreterState.threads.count
 #include "pycore_lock.h"
-#include "pycore_moduleobject.h"  // _PyModule_GetState()
 #include "pycore_modsupport.h"    // _PyArg_NoKeywords()
+#include "pycore_moduleobject.h"  // _PyModule_GetState()
+#include "pycore_object_deferred.h" // _PyObject_SetDeferredRefcount()
 #include "pycore_pylifecycle.h"
 #include "pycore_pystate.h"       // _PyThreadState_SetCurrent()
 #include "pycore_sysmodule.h"     // _PySys_GetOptionalAttr()
index 635da094e37a295ed2892ab27bd80c7482b6dd2c..33505b40a7329f61e155933a282706872e7dccfa 100644 (file)
@@ -2,6 +2,7 @@
 #include "opcode.h"
 
 #include "pycore_code.h"          // _PyCodeConstructor
+#include "pycore_function.h"      // _PyFunction_ClearCodeByVersion()
 #include "pycore_hashtable.h"     // _Py_hashtable_t
 #include "pycore_index_pool.h"    // _PyIndexPool_Fini()
 #include "pycore_initconfig.h"    // _PyStatus_OK()
index 238becee241d1de4c4f0c898b19da91ade8c7529..451e07f58e161e888f2d6d0469e8f9c9b0259559 100644 (file)
@@ -8,6 +8,7 @@
 #include "pycore_descrobject.h"   // _PyMethodWrapper_Type
 #include "pycore_modsupport.h"    // _PyArg_UnpackStack()
 #include "pycore_object.h"        // _PyObject_GC_UNTRACK()
+#include "pycore_object_deferred.h" // _PyObject_SetDeferredRefcount()
 #include "pycore_pystate.h"       // _PyThreadState_GET()
 #include "pycore_tuple.h"         // _PyTuple_ITEMS()
 
index f5e519dad471e883f3f15f3c5c87c537bd7cefb2..6d71dbb5a6affd050e747dba9c4cbc3c59541f5d 100644 (file)
@@ -1,12 +1,12 @@
-
 /* Function object implementation */
 
 #include "Python.h"
-#include "pycore_dict.h"                // _Py_INCREF_DICT()
-#include "pycore_long.h"                // _PyLong_GetOne()
-#include "pycore_modsupport.h"          // _PyArg_NoKeywords()
-#include "pycore_object.h"              // _PyObject_GC_UNTRACK()
-#include "pycore_pyerrors.h"            // _PyErr_Occurred()
+#include "pycore_dict.h"          // _Py_INCREF_DICT()
+#include "pycore_function.h"      // _PyFunction_Vectorcall
+#include "pycore_long.h"          // _PyLong_GetOne()
+#include "pycore_modsupport.h"    // _PyArg_NoKeywords()
+#include "pycore_object.h"        // _PyObject_GC_UNTRACK()
+#include "pycore_pyerrors.h"      // _PyErr_Occurred()
 #include "pycore_stats.h"
 
 
index 2412f994d4bf51eece5d6db9795eaef34a296a1f..46dea1534cbcd62d109bc19d412eb1688db2290d 100644 (file)
@@ -1,4 +1,3 @@
-
 /* Module object implementation */
 
 #include "Python.h"
index 189a673882dc782cf44bc5f603e1cc188851ebbc..be85a20c00dfea8b617331b453aaf5d2aabcdfe1 100644 (file)
@@ -1,14 +1,14 @@
 /* Python's malloc wrappers (see pymem.h) */
 
 #include "Python.h"
-#include "pycore_code.h"          // stats
 #include "pycore_interp.h"        // _PyInterpreterState_HasFeature
 #include "pycore_object.h"        // _PyDebugAllocatorStats() definition
 #include "pycore_obmalloc.h"
+#include "pycore_obmalloc_init.h"
 #include "pycore_pyerrors.h"      // _Py_FatalErrorFormat()
 #include "pycore_pymem.h"
 #include "pycore_pystate.h"       // _PyInterpreterState_GET
-#include "pycore_obmalloc_init.h"
+#include "pycore_stats.h"         // OBJECT_STAT_INC_COND()
 
 #include <stdlib.h>               // malloc()
 #include <stdbool.h>