comparison Python/pythonrun.c @ 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 215297665098
children 367167f93c30
comparison
equal deleted inserted replaced
80776:04eb89e078b5 80777:c40f4c19d20b
36 #endif 36 #endif
37 37
38 #ifndef Py_REF_DEBUG 38 #ifndef Py_REF_DEBUG
39 #define PRINT_TOTAL_REFS() 39 #define PRINT_TOTAL_REFS()
40 #else /* Py_REF_DEBUG */ 40 #else /* Py_REF_DEBUG */
41 #define PRINT_TOTAL_REFS() fprintf(stderr, \ 41 #define PRINT_TOTAL_REFS() fprintf(stderr, \
42 "[%" PY_FORMAT_SIZE_T "d refs]\n", \ 42 "[%" PY_FORMAT_SIZE_T "d refs, " \
43 _Py_GetRefTotal()) 43 "%" PY_FORMAT_SIZE_T "d blocks]\n", \
44 _Py_GetRefTotal(), _Py_GetAllocatedBlocks())
44 #endif 45 #endif
45 46
46 #ifdef __cplusplus 47 #ifdef __cplusplus
47 extern "C" { 48 extern "C" {
48 #endif 49 #endif