mirror of
https://github.com/python/cpython.git
synced 2025-09-13 20:27:05 +00:00
Finalize the freelist of list objects.
This commit is contained in:
parent
ffa5cf9eae
commit
fb09f0e85c
3 changed files with 15 additions and 0 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue