diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2011-12-16 10:24:27 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2011-12-16 10:24:27 (GMT) |
commit | 093ce9cd8c6e4287bffac9d9519d5159d788a008 (patch) | |
tree | 2b8bba612cf0390e8a5b098d2fbf88382c909940 /Objects/setobject.c | |
parent | c144a93e987600196aaf5e8ec65a5eac76af29cd (diff) | |
download | cpython-093ce9cd8c6e4287bffac9d9519d5159d788a008.zip cpython-093ce9cd8c6e4287bffac9d9519d5159d788a008.tar.gz cpython-093ce9cd8c6e4287bffac9d9519d5159d788a008.tar.bz2 |
Issue #6695: Full garbage collection runs now clear the freelist of set objects.
Initial patch by Matthias Troffaes.
Diffstat (limited to 'Objects/setobject.c')
-rw-r--r-- | Objects/setobject.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Objects/setobject.c b/Objects/setobject.c index 5375bd1..a05a97b 100644 --- a/Objects/setobject.c +++ b/Objects/setobject.c @@ -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); } |