Skip to content

Commit 1a08208

Browse files
authored
gh-131238: Remove pycore_object_deferred.h from pycore_object.h (#131549)
Remove also pycore_function.h from pycore_typeobject.h.
1 parent 3a09986 commit 1a08208

10 files changed

+23
-20
lines changed

Include/internal/pycore_interpframe.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@
1010
#endif
1111

1212
#include "pycore_code.h" // _PyCode_CODE()
13-
#include "pycore_structs.h" // _PyStackRef
1413
#include "pycore_stackref.h" // PyStackRef_AsPyObjectBorrow()
14+
#include "pycore_stats.h" // CALL_STAT_INC()
15+
#include "pycore_structs.h" // _PyStackRef
1516
#include "pycore_typedefs.h" // _PyInterpreterFrame
1617

1718

Include/internal/pycore_object.h

+5-3
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,17 @@ extern "C" {
88
# error "this header requires Py_BUILD_CORE define"
99
#endif
1010

11-
#include <stdbool.h>
1211
#include "pycore_emscripten_trampoline.h" // _PyCFunction_TrampolineCall()
13-
#include "pycore_object_deferred.h" // _PyObject_HasDeferredRefcount
14-
#include "pycore_pyatomic_ft_wrappers.h" // FT_ATOMIC_STORE_PTR_RELAXED
12+
#include "pycore_gc.h" // _PyObject_GC_TRACK()
13+
#include "pycore_pyatomic_ft_wrappers.h" // FT_ATOMIC_LOAD_PTR_ACQUIRE()
1514
#include "pycore_pystate.h" // _PyInterpreterState_GET()
1615
#include "pycore_runtime.h" // _PyRuntime
1716
#include "pycore_typeobject.h" // _PyStaticType_GetState()
1817
#include "pycore_uniqueid.h" // _PyObject_ThreadIncrefSlow()
1918

19+
#include <stdbool.h> // bool
20+
21+
2022
// This value is added to `ob_ref_shared` for objects that use deferred
2123
// reference counting so that they are not immediately deallocated when the
2224
// non-deferred reference count drops to zero.

Include/internal/pycore_stackref.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ extern "C" {
1313
# error "this header requires Py_BUILD_CORE define"
1414
#endif
1515

16-
#include "pycore_object_deferred.h"
17-
#include "pycore_object.h"
16+
#include "pycore_object.h" // Py_DECREF_MORTAL
17+
#include "pycore_object_deferred.h" // _PyObject_HasDeferredRefcount()
18+
19+
#include <stdbool.h> // bool
1820

19-
#include <stddef.h>
20-
#include <stdbool.h>
2121

2222
/*
2323
This file introduces a new API for handling references on the stack, called

Include/internal/pycore_typeobject.h

-2
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,8 @@ extern "C" {
88
# error "this header requires Py_BUILD_CORE define"
99
#endif
1010

11-
#include "pycore_function.h"
1211
#include "pycore_interp_structs.h" // managed_static_type_state
1312
#include "pycore_moduleobject.h" // PyModuleObject
14-
#include "pycore_stats.h"
1513

1614

1715
/* state */

Modules/_threadmodule.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
#include "pycore_fileutils.h" // _PyFile_Flush
66
#include "pycore_interp.h" // _PyInterpreterState.threads.count
77
#include "pycore_lock.h"
8-
#include "pycore_moduleobject.h" // _PyModule_GetState()
98
#include "pycore_modsupport.h" // _PyArg_NoKeywords()
9+
#include "pycore_moduleobject.h" // _PyModule_GetState()
10+
#include "pycore_object_deferred.h" // _PyObject_SetDeferredRefcount()
1011
#include "pycore_pylifecycle.h"
1112
#include "pycore_pystate.h" // _PyThreadState_SetCurrent()
1213
#include "pycore_sysmodule.h" // _PySys_GetOptionalAttr()

Objects/codeobject.c

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#include "opcode.h"
33

44
#include "pycore_code.h" // _PyCodeConstructor
5+
#include "pycore_function.h" // _PyFunction_ClearCodeByVersion()
56
#include "pycore_hashtable.h" // _Py_hashtable_t
67
#include "pycore_index_pool.h" // _PyIndexPool_Fini()
78
#include "pycore_initconfig.h" // _PyStatus_OK()

Objects/descrobject.c

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include "pycore_descrobject.h" // _PyMethodWrapper_Type
99
#include "pycore_modsupport.h" // _PyArg_UnpackStack()
1010
#include "pycore_object.h" // _PyObject_GC_UNTRACK()
11+
#include "pycore_object_deferred.h" // _PyObject_SetDeferredRefcount()
1112
#include "pycore_pystate.h" // _PyThreadState_GET()
1213
#include "pycore_tuple.h" // _PyTuple_ITEMS()
1314

Objects/funcobject.c

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
21
/* Function object implementation */
32

43
#include "Python.h"
5-
#include "pycore_dict.h" // _Py_INCREF_DICT()
6-
#include "pycore_long.h" // _PyLong_GetOne()
7-
#include "pycore_modsupport.h" // _PyArg_NoKeywords()
8-
#include "pycore_object.h" // _PyObject_GC_UNTRACK()
9-
#include "pycore_pyerrors.h" // _PyErr_Occurred()
4+
#include "pycore_dict.h" // _Py_INCREF_DICT()
5+
#include "pycore_function.h" // _PyFunction_Vectorcall
6+
#include "pycore_long.h" // _PyLong_GetOne()
7+
#include "pycore_modsupport.h" // _PyArg_NoKeywords()
8+
#include "pycore_object.h" // _PyObject_GC_UNTRACK()
9+
#include "pycore_pyerrors.h" // _PyErr_Occurred()
1010
#include "pycore_stats.h"
1111

1212

Objects/moduleobject.c

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/* Module object implementation */
32

43
#include "Python.h"

Objects/obmalloc.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
/* Python's malloc wrappers (see pymem.h) */
22

33
#include "Python.h"
4-
#include "pycore_code.h" // stats
54
#include "pycore_interp.h" // _PyInterpreterState_HasFeature
65
#include "pycore_object.h" // _PyDebugAllocatorStats() definition
76
#include "pycore_obmalloc.h"
7+
#include "pycore_obmalloc_init.h"
88
#include "pycore_pyerrors.h" // _Py_FatalErrorFormat()
99
#include "pycore_pymem.h"
1010
#include "pycore_pystate.h" // _PyInterpreterState_GET
11-
#include "pycore_obmalloc_init.h"
11+
#include "pycore_stats.h" // OBJECT_STAT_INC_COND()
1212

1313
#include <stdlib.h> // malloc()
1414
#include <stdbool.h>

0 commit comments

Comments
 (0)