Mercurial > cpython-lru_cache-weakref
diff Include/objimpl.h @ 80777:c40f4c19d20b
Issue #13390: New function :func:`sys.getallocatedblocks()` returns the number of memory blocks currently allocated.
Also, the ``-R`` option to regrtest uses this function to guard against memory allocation leaks.
| author | Antoine Pitrou <solipsis@pitrou.net> |
|---|---|
| date | Sun, 09 Dec 2012 14:28:26 +0100 |
| parents | 99112b851b25 |
| children | d61a1be9f5c5 |
line wrap: on
line diff
--- a/Include/objimpl.h Sun Dec 09 16:22:17 2012 +1000 +++ b/Include/objimpl.h Sun Dec 09 14:28:26 2012 +0100 @@ -98,6 +98,8 @@ PyAPI_FUNC(void *) PyObject_Realloc(void *, size_t); PyAPI_FUNC(void) PyObject_Free(void *); +/* This function returns the number of allocated memory blocks, regardless of size */ +PyAPI_FUNC(Py_ssize_t) _Py_GetAllocatedBlocks(void); /* Macros */ #ifdef WITH_PYMALLOC
