diff options
author | Christian Heimes <christian@cheimes.de> | 2008-01-27 23:34:59 (GMT) |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2008-01-27 23:34:59 (GMT) |
commit | 908caac52e8e62baa1ee54e4e650e1cd3ac37907 (patch) | |
tree | 291efd46f16d74de6e49bba69f785883c6cdfcc1 /Python/sysmodule.c | |
parent | 3ea7b41b5805c60a05e697211d0bfc14a62a19fb (diff) | |
download | cpython-908caac52e8e62baa1ee54e4e650e1cd3ac37907.zip cpython-908caac52e8e62baa1ee54e4e650e1cd3ac37907.tar.gz cpython-908caac52e8e62baa1ee54e4e650e1cd3ac37907.tar.bz2 |
Added clear cache methods to clear the internal type lookup cache for ref leak test runs.
Diffstat (limited to 'Python/sysmodule.c')
-rw-r--r-- | Python/sysmodule.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c index 12ad828..f9fb815 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -754,6 +754,17 @@ a 11-tuple where the entries in the tuple are counts of:\n\ 10. Number of stack pops performed by call_function()" ); +static PyObject * +sys_cleartypecache(PyObject* self, PyObject* args) +{ + PyType_ClearCache(); + Py_RETURN_NONE; +} + +PyDoc_STRVAR(cleartypecache_doc, +"_cleartypecache() -> None\n\ +Clear the internal type lookup cache."); + #ifdef __cplusplus extern "C" { #endif @@ -776,6 +787,8 @@ static PyMethodDef sys_methods[] = { /* Might as well keep this in alphabetic order */ {"callstats", (PyCFunction)PyEval_GetCallStats, METH_NOARGS, callstats_doc}, + {"_cleartypecache", sys_cleartypecache, METH_NOARGS, + cleartypecache_doc}, {"_current_frames", sys_current_frames, METH_NOARGS, current_frames_doc}, {"displayhook", sys_displayhook, METH_O, displayhook_doc}, |