mirror of
https://github.com/python/cpython.git
synced 2025-12-09 18:48:05 +00:00
Issue #13389: Full garbage collection passes now clear the freelists for
list and dict objects. They already cleared other freelists in the interpreter.
This commit is contained in:
parent
d8b9ae6e8f
commit
9a812cbc89
8 changed files with 44 additions and 6 deletions
|
|
@ -97,16 +97,23 @@ show_alloc(void)
|
|||
static PyListObject *free_list[PyList_MAXFREELIST];
|
||||
static int numfree = 0;
|
||||
|
||||
void
|
||||
PyList_Fini(void)
|
||||
int
|
||||
PyList_ClearFreeList(void)
|
||||
{
|
||||
PyListObject *op;
|
||||
|
||||
int ret = numfree;
|
||||
while (numfree) {
|
||||
op = free_list[--numfree];
|
||||
assert(PyList_CheckExact(op));
|
||||
PyObject_GC_Del(op);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
void
|
||||
PyList_Fini(void)
|
||||
{
|
||||
PyList_ClearFreeList();
|
||||
}
|
||||
|
||||
PyObject *
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue