summaryrefslogtreecommitdiffstats
path: root/Objects/tupleobject.c
diff options
context:
space:
mode:
authorFedora Python maintainers <python-devel@lists.fedoraproject.org>2020-07-15 13:37:52 (GMT)
committerPetr Viktorin <pviktori@redhat.com>2020-09-29 13:59:05 (GMT)
commitb4f5b3de3f77729901d4ae35f4ea001e7ad73199 (patch)
tree1d9e5e96d156402c5168900e6e2572bdaa22c806 /Objects/tupleobject.c
parenta152631688d0889ab1f857e3c4cdfa7357c7f28c (diff)
downloadcpython-b4f5b3de3f77729901d4ae35f4ea001e7ad73199.zip
cpython-b4f5b3de3f77729901d4ae35f4ea001e7ad73199.tar.gz
cpython-b4f5b3de3f77729901d4ae35f4ea001e7ad73199.tar.bz2
00147-add-debug-malloc-stats.patch
00147 # Add a sys._debugmallocstats() function Based on patch 202 from RHEL 5's python.spec, with updates from rhbz#737198 Sent upstream as http://bugs.python.org/issue14785
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 6f4b18c..e8e4490 100644
--- a/Objects/tupleobject.c
+++ b/Objects/tupleobject.c
@@ -44,6 +44,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)