mirror of
https://github.com/python/cpython
synced 2024-11-05 18:12:54 +00:00
17 lines
481 B
C
17 lines
481 B
C
#include "Python.h"
|
|
#include "pycore_pystate.h" // _Py_ClearFreeLists()
|
|
|
|
#ifndef Py_GIL_DISABLED
|
|
|
|
/* Clear all free lists
|
|
* All free lists are cleared during the collection of the highest generation.
|
|
* Allocated items in the free list may keep a pymalloc arena occupied.
|
|
* Clearing the free lists may give back memory to the OS earlier.
|
|
*/
|
|
void
|
|
_PyGC_ClearAllFreeLists(PyInterpreterState *interp)
|
|
{
|
|
_PyObject_ClearFreeLists(&interp->object_state.freelists, 0);
|
|
}
|
|
|
|
#endif
|