summaryrefslogtreecommitdiffstats
path: root/Objects/listobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/listobject.c')
-rw-r--r--Objects/listobject.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/Objects/listobject.c b/Objects/listobject.c
index 6e2d026..ddc0fee 100644
--- a/Objects/listobject.c
+++ b/Objects/listobject.c
@@ -82,6 +82,16 @@ static size_t count_reuse = 0;
static void
show_alloc(void)
{
+ PyObject *xoptions, *value;
+ _Py_IDENTIFIER(showalloccount);
+
+ xoptions = PySys_GetXOptions();
+ if (xoptions == NULL)
+ return;
+ value = _PyDict_GetItemId(xoptions, &PyId_showalloccount);
+ if (value != Py_True)
+ return;
+
fprintf(stderr, "List allocations: %" PY_FORMAT_SIZE_T "d\n",
count_alloc);
fprintf(stderr, "List reuse through freelist: %" PY_FORMAT_SIZE_T