Skip to content

Commit 716a5f3

Browse files
committed
Hook up mi_collect for debugging
1 parent 82642cc commit 716a5f3

File tree

2 files changed

+88
-1
lines changed

2 files changed

+88
-1
lines changed

Python/clinic/sysmodule.c.h

Lines changed: 71 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Python/sysmodule.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2035,6 +2035,22 @@ extern PyObject *_Py_GetDXProfile(PyObject *, PyObject *);
20352035
}
20362036
#endif
20372037

2038+
#ifdef WITH_MIMALLOC
2039+
/*[clinic input]
2040+
sys._mi_collect
2041+
2042+
force: bool = False
2043+
2044+
[clinic start generated code]*/
2045+
2046+
static PyObject *
2047+
sys__mi_collect_impl(PyObject *module, int force)
2048+
/*[clinic end generated code: output=c674624749771706 input=f6a11d7d4e5731c8]*/
2049+
{
2050+
mi_collect(force);
2051+
Py_RETURN_NONE;
2052+
}
2053+
#endif
20382054

20392055
/*[clinic input]
20402056
sys._clear_type_cache
@@ -2277,6 +2293,7 @@ static PyMethodDef sys_methods[] = {
22772293
SYS__STATS_CLEAR_METHODDEF
22782294
SYS__STATS_DUMP_METHODDEF
22792295
#endif
2296+
SYS__MI_COLLECT_METHODDEF
22802297
{NULL, NULL} // sentinel
22812298
};
22822299

0 commit comments

Comments
 (0)