summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2004-10-07 03:58:07 (GMT)
committerRaymond Hettinger <python@rcn.com>2004-10-07 03:58:07 (GMT)
commitfb09f0e85cd75ec46700562687a9da3063ff0b7c (patch)
tree046a3a4da2f9e72db87152cd653d9159d5a9416f /Objects
parentffa5cf9eae5fff1e46e8962cd957fd2ffe5a77cb (diff)
downloadcpython-fb09f0e85cd75ec46700562687a9da3063ff0b7c.zip
cpython-fb09f0e85cd75ec46700562687a9da3063ff0b7c.tar.gz
cpython-fb09f0e85cd75ec46700562687a9da3063ff0b7c.tar.bz2
Finalize the freelist of list objects.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/listobject.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/Objects/listobject.c b/Objects/listobject.c
index 44616e5..08ab095 100644
--- a/Objects/listobject.c
+++ b/Objects/listobject.c
@@ -68,6 +68,19 @@ list_resize(PyListObject *self, int newsize)
static PyListObject *free_lists[MAXFREELISTS];
static int num_free_lists = 0;
+void
+PyList_Fini(void)
+{
+ PyListObject *op;
+
+ while (num_free_lists) {
+ num_free_lists--;
+ op = free_lists[num_free_lists];
+ assert(PyList_CheckExact(op));
+ PyObject_GC_Del(op);
+ }
+}
+
PyObject *
PyList_New(int size)
{