diff options
author | Guido van Rossum <guido@python.org> | 2012-06-22 15:18:38 -0700 |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2012-06-22 15:18:38 -0700 |
commit | 8e0d25504c5a7309bdebda33b3aa9b8213896907 (patch) | |
tree | b7b95aae5a041d01b70d3d26d7d3b1b853749af9 /Python/sysmodule.c | |
parent | 95c1c48fd6841230c6e8600b604e8460010ab399 (diff) | |
parent | 541b7c89ff179a945fb4f5745efc484df646a751 (diff) | |
download | cpython-git-8e0d25504c5a7309bdebda33b3aa9b8213896907.tar.gz |
Merge
Diffstat (limited to 'Python/sysmodule.c')
-rw-r--r-- | Python/sysmodule.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c index 096e51e9f9..ce5e8258d1 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -997,6 +997,27 @@ a 11-tuple where the entries in the tuple are counts of:\n\ extern "C" { #endif +static PyObject * +sys_debugmallocstats(PyObject *self, PyObject *args) +{ +#ifdef WITH_PYMALLOC + _PyObject_DebugMallocStats(stderr); + fputc('\n', stderr); +#endif + _PyObject_DebugTypeStats(stderr); + + Py_RETURN_NONE; +} +PyDoc_STRVAR(debugmallocstats_doc, +"_debugmallocstats()\n\ +\n\ +Print summary info to stderr about the state of\n\ +pymalloc's structures.\n\ +\n\ +In Py_DEBUG mode, also perform some expensive internal consistency\n\ +checks.\n\ +"); + #ifdef Py_TRACE_REFS /* Defined in objects.c because it uses static globals if that file */ extern PyObject *_Py_GetObjects(PyObject *, PyObject *); @@ -1093,6 +1114,8 @@ static PyMethodDef sys_methods[] = { {"settrace", sys_settrace, METH_O, settrace_doc}, {"gettrace", sys_gettrace, METH_NOARGS, gettrace_doc}, {"call_tracing", sys_call_tracing, METH_VARARGS, call_tracing_doc}, + {"_debugmallocstats", sys_debugmallocstats, METH_VARARGS, + debugmallocstats_doc}, {NULL, NULL} /* sentinel */ }; |