mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
Issue #6695: Full garbage collection runs now clear the freelist of set objects.
Initial patch by Matthias Troffaes.
This commit is contained in:
parent
c144a93e98
commit
093ce9cd8c
5 changed files with 23 additions and 2 deletions
|
@ -1068,9 +1068,10 @@ frozenset_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
|
|||
return emptyfrozenset;
|
||||
}
|
||||
|
||||
void
|
||||
PySet_Fini(void)
|
||||
int
|
||||
PySet_ClearFreeList(void)
|
||||
{
|
||||
int freelist_size = numfree;
|
||||
PySetObject *so;
|
||||
|
||||
while (numfree) {
|
||||
|
@ -1078,6 +1079,13 @@ PySet_Fini(void)
|
|||
so = free_list[numfree];
|
||||
PyObject_GC_Del(so);
|
||||
}
|
||||
return freelist_size;
|
||||
}
|
||||
|
||||
void
|
||||
PySet_Fini(void)
|
||||
{
|
||||
PySet_ClearFreeList();
|
||||
Py_CLEAR(dummy);
|
||||
Py_CLEAR(emptyfrozenset);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue