mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #23034: The output of a special Python build with defined COUNT_ALLOCS,
SHOW_ALLOC_COUNT or SHOW_TRACK_COUNT macros is now off by default. It can be re-enabled using the "-X showalloccount" option. It now outputs to stderr instead of stdout.
This commit is contained in:
parent
6c94d10a19
commit
7e160ce356
7 changed files with 50 additions and 1 deletions
|
@ -109,6 +109,15 @@ void
|
|||
dump_counts(FILE* f)
|
||||
{
|
||||
PyTypeObject *tp;
|
||||
PyObject *xoptions, *value;
|
||||
_Py_IDENTIFIER(showalloccount);
|
||||
|
||||
xoptions = PySys_GetXOptions();
|
||||
if (xoptions == NULL)
|
||||
return;
|
||||
value = _PyDict_GetItemId(xoptions, &PyId_showalloccount);
|
||||
if (value != Py_True)
|
||||
return;
|
||||
|
||||
for (tp = type_list; tp; tp = tp->tp_next)
|
||||
fprintf(f, "%s alloc'd: %" PY_FORMAT_SIZE_T "d, "
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue