bpo-40170: Remove _Py_GetAllocatedBlocks() function (GH-30940) · python/cpython@6b491b9 · GitHub
Skip to content

Commit 6b491b9

Browse files
authored
bpo-40170: Remove _Py_GetAllocatedBlocks() function (GH-30940)
Move _Py_GetAllocatedBlocks() and _PyObject_DebugMallocStats() private functions to the internal C API.
1 parent af32b3e commit 6b491b9

4 files changed

Lines changed: 16 additions & 9 deletions

File tree

Include/cpython/objimpl.h

Lines changed: 0 additions & 8 deletions

Include/internal/pycore_object.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,15 @@ extern void _PyObject_FreeInstanceAttributes(PyObject *self);
232232
extern int _PyObject_IsInstanceDictEmpty(PyObject *);
233233
extern PyObject* _PyType_GetSubclasses(PyTypeObject *);
234234

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+
235244
#ifdef __cplusplus
236245
}
237246
#endif
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Move _Py_GetAllocatedBlocks() and _PyObject_DebugMallocStats() private
2+
functions to the internal C API. Patch by Victor Stinner.

Objects/obmalloc.c

Lines changed: 5 additions & 1 deletion

0 commit comments

Comments
 (0)