summaryrefslogtreecommitdiffstats
path: root/Python/gc_gil.c
blob: 7d62a9ed0b1ca8b2262d9b4e7c8d01a0f9e5eceb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#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