mirror of
https://github.com/python/cpython.git
synced 2025-09-15 05:06:12 +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
|
@ -2626,9 +2626,11 @@ PyTypeObject PyMethod_Type = {
|
|||
|
||||
/* Clear out the free list */
|
||||
|
||||
void
|
||||
PyMethod_Fini(void)
|
||||
int
|
||||
PyMethod_ClearFreeList(void)
|
||||
{
|
||||
int freelist_size = numfree;
|
||||
|
||||
while (free_list) {
|
||||
PyMethodObject *im = free_list;
|
||||
free_list = (PyMethodObject *)(im->im_self);
|
||||
|
@ -2636,4 +2638,11 @@ PyMethod_Fini(void)
|
|||
numfree--;
|
||||
}
|
||||
assert(numfree == 0);
|
||||
return freelist_size;
|
||||
}
|
||||
|
||||
void
|
||||
PyMethod_Fini(void)
|
||||
{
|
||||
(void)PyMethod_ClearFreeList();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue