Kaydet (Commit) fb09f0e8 authored tarafından Raymond Hettinger's avatar Raymond Hettinger

Finalize the freelist of list objects.

üst ffa5cf9e
......@@ -113,6 +113,7 @@ PyAPI_FUNC(void) PyMethod_Fini(void);
PyAPI_FUNC(void) PyFrame_Fini(void);
PyAPI_FUNC(void) PyCFunction_Fini(void);
PyAPI_FUNC(void) PyTuple_Fini(void);
PyAPI_FUNC(void) PyList_Fini(void);
PyAPI_FUNC(void) PyString_Fini(void);
PyAPI_FUNC(void) PyInt_Fini(void);
PyAPI_FUNC(void) PyFloat_Fini(void);
......
......@@ -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)
{
......
......@@ -416,6 +416,7 @@ Py_Finalize(void)
PyFrame_Fini();
PyCFunction_Fini();
PyTuple_Fini();
PyList_Fini();
PyString_Fini();
PyInt_Fini();
PyFloat_Fini();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment