0
0
mirror of https://github.com/python/cpython.git synced 2024-11-27 23:47:29 +01:00
cpython/Python/gc_gil.c

18 lines
488 B
C
Raw Normal View History

#include "Python.h"
#include "pycore_freelist.h" // _PyObject_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