mirror of
https://github.com/python/cpython.git
synced 2025-07-10 04:45:36 +00:00
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:
parent
b4b8f234d4
commit
f9d0b1256f
9 changed files with 123 additions and 22 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue