bpo-40170: Move _Py_GetAllocatedBlocks() to pycore_pymem.h (GH-30943) · python/cpython@0575551 (original) (raw)

4 files changed

lines changed

Original file line number Diff line number Diff line change
@@ -232,15 +232,6 @@ extern void _PyObject_FreeInstanceAttributes(PyObject *self);
232 232 extern int _PyObject_IsInstanceDictEmpty(PyObject *);
233 233 extern PyObject* _PyType_GetSubclasses(PyTypeObject *);
234 234
235 -/* This function returns the number of allocated memory blocks, regardless of size */
236 -PyAPI_FUNC(Py_ssize_t) _Py_GetAllocatedBlocks(void);
237 -
238 -/* Macros */
239 -#ifdef WITH_PYMALLOC
240 -// Export the symbol for the 3rd party guppy3 project
241 -PyAPI_FUNC(int) _PyObject_DebugMallocStats(FILE *out);
242 -#endif
243 -
244 235 #ifdef __cplusplus
245 236 }
246 237 #endif
Original file line number Diff line number Diff line change
@@ -99,6 +99,14 @@ PyAPI_DATA(struct _PyTraceMalloc_Config) _Py_tracemalloc_config;
99 99 void *_PyObject_VirtualAlloc(size_t size);
100 100 void _PyObject_VirtualFree(void *, size_t size);
101 101
102 +/* This function returns the number of allocated memory blocks, regardless of size */
103 +PyAPI_FUNC(Py_ssize_t) _Py_GetAllocatedBlocks(void);
104 +
105 +/* Macros */
106 +#ifdef WITH_PYMALLOC
107 +// Export the symbol for the 3rd party guppy3 project
108 +PyAPI_FUNC(int) _PyObject_DebugMallocStats(FILE *out);
109 +#endif
102 110
103 111 #ifdef __cplusplus
104 112 }
Original file line number Diff line number Diff line change
@@ -8,9 +8,6 @@
8 8 /* Defined in tracemalloc.c */
9 9 extern void _PyMem_DumpTraceback(int fd, const void *ptr);
10 10
11 -// Forward declaration
12 -int _PyObject_DebugMallocStats(FILE *out);
13 -
14 11
15 12 /* Python's malloc wrappers (see pymem.h) */
16 13
Original file line number Diff line number Diff line change
@@ -19,6 +19,7 @@
19 19 #include "pycore_pathconfig.h" // _PyConfig_WritePathConfig()
20 20 #include "pycore_pyerrors.h" // _PyErr_Occurred()
21 21 #include "pycore_pylifecycle.h" // _PyErr_Print()
22 +#include "pycore_pymem.h" // _PyObject_DebugMallocStats()
22 23 #include "pycore_pystate.h" // _PyThreadState_GET()
23 24 #include "pycore_runtime_init.h" // _PyRuntimeState_INIT
24 25 #include "pycore_sliceobject.h" // _PySlice_Fini()