/* 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. */ static void clear_freelists(void) { (void)PyMethod_ClearFreeList(); (void)PyFrame_ClearFreeList(); (void)PyCFunction_ClearFreeList(); (void)PyTuple_ClearFreeList(); (void)PyUnicode_ClearFreeList(); (void)PyFloat_ClearFreeList(); }
/* 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. */ static void clear_freelists(void) { (void)PyMethod_ClearFreeList(); (void)PyFrame_ClearFreeList(); (void)PyCFunction_ClearFreeList(); (void)PyTuple_ClearFreeList(); #ifdef Py_USING_UNICODE (void)PyUnicode_ClearFreeList(); #endif (void)PyInt_ClearFreeList(); (void)PyFloat_ClearFreeList(); }
void PyTuple_Fini(void) { #if PyTuple_MAXSAVESIZE > 0 /* empty tuples are used all over the place and applications may * rely on the fact that an empty tuple is a singleton. */ Py_CLEAR(free_list[0]); (void)PyTuple_ClearFreeList(); #endif #ifdef SHOW_TRACK_COUNT show_track(); #endif }