summaryrefslogtreecommitdiff
path: root/Objects/methodobject.c
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2012-06-22 14:55:41 -0400
committerDavid Malcolm <dmalcolm@redhat.com>2012-06-22 14:55:41 -0400
commit49526f48fc73d3ccdf09d466ed2d39a30e4df9b9 (patch)
tree51ac80c4d09ca4a537518555710423675a6ac731 /Objects/methodobject.c
parent69cf913ba110de2eb773c030b1dd606456ac5831 (diff)
downloadcpython-git-49526f48fc73d3ccdf09d466ed2d39a30e4df9b9.tar.gz
Issue #14785: Add sys._debugmallocstats() to help debug low-level memory allocation issues
Diffstat (limited to 'Objects/methodobject.c')
-rw-r--r--Objects/methodobject.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/Objects/methodobject.c b/Objects/methodobject.c
index c3a64098dc..1d143f9131 100644
--- a/Objects/methodobject.c
+++ b/Objects/methodobject.c
@@ -338,6 +338,15 @@ PyCFunction_Fini(void)
(void)PyCFunction_ClearFreeList();
}
+/* Print summary info about the state of the optimized allocator */
+void
+_PyCFunction_DebugMallocStats(FILE *out)
+{
+ _PyDebugAllocatorStats(out,
+ "free PyCFunction",
+ numfree, sizeof(PyCFunction));
+}
+
/* PyCFunction_New() is now just a macro that calls PyCFunction_NewEx(),
but it's part of the API so we need to keep a function around that
existing C extensions can call.