• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #include "Python.h"
2 #include "pycore_pystate.h"   // _Py_ClearFreeLists()
3 
4 #ifndef Py_GIL_DISABLED
5 
6 /* Clear all free lists
7  * All free lists are cleared during the collection of the highest generation.
8  * Allocated items in the free list may keep a pymalloc arena occupied.
9  * Clearing the free lists may give back memory to the OS earlier.
10  */
11 void
_PyGC_ClearAllFreeLists(PyInterpreterState * interp)12 _PyGC_ClearAllFreeLists(PyInterpreterState *interp)
13 {
14     _PyObject_ClearFreeLists(&interp->object_state.freelists, 0);
15 }
16 
17 #endif
18