summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2012-12-09 13:28:26 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2012-12-09 13:28:26 (GMT)
commitf9d0b1256fd5a9ae90fa8e8418bd450ec6b7f5f2 (patch)
treefd5ad7ad717440f4586652180cb31a3cf2e52e97 /Include
parentb4b8f234d4407492c4493e3a16bc8263139c7869 (diff)
downloadcpython-f9d0b1256fd5a9ae90fa8e8418bd450ec6b7f5f2.zip
cpython-f9d0b1256fd5a9ae90fa8e8418bd450ec6b7f5f2.tar.gz
cpython-f9d0b1256fd5a9ae90fa8e8418bd450ec6b7f5f2.tar.bz2
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.
Diffstat (limited to 'Include')
-rw-r--r--Include/objimpl.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/Include/objimpl.h b/Include/objimpl.h
index 3d5f509..6346500 100644
--- a/Include/objimpl.h
+++ b/Include/objimpl.h
@@ -98,6 +98,8 @@ PyAPI_FUNC(void *) PyObject_Malloc(size_t);
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