summaryrefslogtreecommitdiff
path: root/Objects/frameobject.c
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2008-02-14 12:47:33 +0000
committerChristian Heimes <christian@cheimes.de>2008-02-14 12:47:33 +0000
commit3b718a79af900fdacaf0b825137f69eadc753765 (patch)
tree71cbe9fcb7b94a2611e5f62cf329285270615e22 /Objects/frameobject.c
parent50361d4d9b3e8729aa535c3dfde3d9d2ad899d47 (diff)
downloadcpython-git-3b718a79af900fdacaf0b825137f69eadc753765.tar.gz
Implemented Martin's suggestion to clear the free lists during the garbage collection of the highest generation.
Diffstat (limited to 'Objects/frameobject.c')
-rw-r--r--Objects/frameobject.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/Objects/frameobject.c b/Objects/frameobject.c
index df9c2e01dc..025431e56b 100644
--- a/Objects/frameobject.c
+++ b/Objects/frameobject.c
@@ -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;
}