summaryrefslogtreecommitdiff
path: root/Python/pythonrun.c
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2012-12-09 14:28:26 +0100
committerAntoine Pitrou <solipsis@pitrou.net>2012-12-09 14:28:26 +0100
commit350e0ff264038e3790d0182134de7959965dea7d (patch)
treeda900c8d363a534757cb8e099b92201340f7acf3 /Python/pythonrun.c
parent4857b8a30dddee2350b0d996b9d83a7d833eb071 (diff)
downloadcpython-350e0ff264038e3790d0182134de7959965dea7d.tar.gz
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 'Python/pythonrun.c')
-rw-r--r--Python/pythonrun.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index dd32017574..f0d8550773 100644
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -38,9 +38,10 @@
#ifndef Py_REF_DEBUG
#define PRINT_TOTAL_REFS()
#else /* Py_REF_DEBUG */
-#define PRINT_TOTAL_REFS() fprintf(stderr, \
- "[%" PY_FORMAT_SIZE_T "d refs]\n", \
- _Py_GetRefTotal())
+#define PRINT_TOTAL_REFS() fprintf(stderr, \
+ "[%" PY_FORMAT_SIZE_T "d refs, " \
+ "%" PY_FORMAT_SIZE_T "d blocks]\n", \
+ _Py_GetRefTotal(), _Py_GetAllocatedBlocks())
#endif
#ifdef __cplusplus