Mercurial > cpython-lru_cache-weakref
diff Objects/methodobject.c @ 77577:d63a80abfbec
Issue #14785: Add sys._debugmallocstats() to help debug low-level memory allocation issues
| author | David Malcolm <dmalcolm@redhat.com> |
|---|---|
| date | Fri, 22 Jun 2012 14:55:41 -0400 |
| parents | 7a7b698f6f21 |
| children | 9e6ead98762e 3a86a3f1d89a |
line wrap: on
line diff
--- a/Objects/methodobject.c Fri Jun 22 18:40:02 2012 +0000 +++ b/Objects/methodobject.c Fri Jun 22 14:55:41 2012 -0400 @@ -338,6 +338,15 @@ (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.
