summaryrefslogtreecommitdiffstats
path: root/Objects/tupleobject.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2012-06-22 22:18:38 (GMT)
committerGuido van Rossum <guido@python.org>2012-06-22 22:18:38 (GMT)
commit8e0d25504c5a7309bdebda33b3aa9b8213896907 (patch)
treeb7b95aae5a041d01b70d3d26d7d3b1b853749af9 /Objects/tupleobject.c
parent95c1c48fd6841230c6e8600b604e8460010ab399 (diff)
parent541b7c89ff179a945fb4f5745efc484df646a751 (diff)
downloadcpython-8e0d25504c5a7309bdebda33b3aa9b8213896907.zip
cpython-8e0d25504c5a7309bdebda33b3aa9b8213896907.tar.gz
cpython-8e0d25504c5a7309bdebda33b3aa9b8213896907.tar.bz2
Merge
Diffstat (limited to 'Objects/tupleobject.c')
-rw-r--r--Objects/tupleobject.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c
index d103b9b..013db69 100644
--- a/Objects/tupleobject.c
+++ b/Objects/tupleobject.c
@@ -45,6 +45,22 @@ show_track(void)
}
#endif
+/* Print summary info about the state of the optimized allocator */
+void
+_PyTuple_DebugMallocStats(FILE *out)
+{
+#if PyTuple_MAXSAVESIZE > 0
+ int i;
+ char buf[128];
+ for (i = 1; i < PyTuple_MAXSAVESIZE; i++) {
+ PyOS_snprintf(buf, sizeof(buf),
+ "free %d-sized PyTupleObject", i);
+ _PyDebugAllocatorStats(out,
+ buf,
+ numfree[i], _PyObject_VAR_SIZE(&PyTuple_Type, i));
+ }
+#endif
+}
PyObject *
PyTuple_New(register Py_ssize_t size)