mirror of
https://github.com/python/cpython.git
synced 2025-09-14 20:56:06 +00:00
Implemented Martin's suggestion to clear the free lists during the garbage collection of the highest generation.
This commit is contained in:
parent
50361d4d9b
commit
3b718a79af
15 changed files with 131 additions and 25 deletions
|
@ -889,10 +889,11 @@ PyFrame_LocalsToFast(PyFrameObject *f, int clear)
|
|||
}
|
||||
|
||||
/* Clear out the free list */
|
||||
|
||||
void
|
||||
PyFrame_Fini(void)
|
||||
int
|
||||
PyFrame_ClearFreeList(void)
|
||||
{
|
||||
int freelist_size = numfree;
|
||||
|
||||
while (free_list != NULL) {
|
||||
PyFrameObject *f = free_list;
|
||||
free_list = free_list->f_back;
|
||||
|
@ -900,6 +901,13 @@ PyFrame_Fini(void)
|
|||
--numfree;
|
||||
}
|
||||
assert(numfree == 0);
|
||||
return freelist_size;
|
||||
}
|
||||
|
||||
void
|
||||
PyFrame_Fini(void)
|
||||
{
|
||||
(void)PyFrame_ClearFreeList();
|
||||
Py_XDECREF(builtin_object);
|
||||
builtin_object = NULL;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue