diff options
author | Victor Stinner <vstinner@python.org> | 2022-01-27 20:23:22 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-27 20:23:22 (GMT) |
commit | 0575551f69ba9c999835bfb176a543d468083c03 (patch) | |
tree | 869e28a7628c05b3b00b711ec90495d885003062 /Include/internal/pycore_pymem.h | |
parent | 6c6a153dee132116611f2d5df0689a5a605f62b6 (diff) | |
download | cpython-0575551f69ba9c999835bfb176a543d468083c03.zip cpython-0575551f69ba9c999835bfb176a543d468083c03.tar.gz cpython-0575551f69ba9c999835bfb176a543d468083c03.tar.bz2 |
bpo-40170: Move _Py_GetAllocatedBlocks() to pycore_pymem.h (GH-30943)
Move _Py_GetAllocatedBlocks() and _PyObject_DebugMallocStats()
declarations to pycore_pymem.h. These functions are related to memory
allocators, not to the PyObject structure.
Diffstat (limited to 'Include/internal/pycore_pymem.h')
-rw-r--r-- | Include/internal/pycore_pymem.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Include/internal/pycore_pymem.h b/Include/internal/pycore_pymem.h index d70deee..b9eea9d 100644 --- a/Include/internal/pycore_pymem.h +++ b/Include/internal/pycore_pymem.h @@ -99,6 +99,14 @@ PyAPI_DATA(struct _PyTraceMalloc_Config) _Py_tracemalloc_config; void *_PyObject_VirtualAlloc(size_t size); void _PyObject_VirtualFree(void *, size_t size); +/* This function returns the number of allocated memory blocks, regardless of size */ +PyAPI_FUNC(Py_ssize_t) _Py_GetAllocatedBlocks(void); + +/* Macros */ +#ifdef WITH_PYMALLOC +// Export the symbol for the 3rd party guppy3 project +PyAPI_FUNC(int) _PyObject_DebugMallocStats(FILE *out); +#endif #ifdef __cplusplus } |