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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user