mirror of
https://github.com/python/cpython.git
synced 2025-11-24 20:30:18 +00:00
gh-111968: Refactor _PyXXX_Fini to integrate with _PyObject_ClearFreeLists (gh-114899)
This commit is contained in:
parent
564385612c
commit
d4d5bae147
20 changed files with 38 additions and 107 deletions
|
|
@ -793,6 +793,21 @@ PyObject_Bytes(PyObject *v)
|
|||
return PyBytes_FromObject(v);
|
||||
}
|
||||
|
||||
void
|
||||
_PyObject_ClearFreeLists(_PyFreeListState *state, int is_finalization)
|
||||
{
|
||||
// In the free-threaded build, freelists are per-PyThreadState and cleared in PyThreadState_Clear()
|
||||
// In the default build, freelists are per-interpreter and cleared in finalize_interp_types()
|
||||
_PyFloat_ClearFreeList(state, is_finalization);
|
||||
_PyTuple_ClearFreeList(state, is_finalization);
|
||||
_PyList_ClearFreeList(state, is_finalization);
|
||||
_PyDict_ClearFreeList(state, is_finalization);
|
||||
_PyContext_ClearFreeList(state, is_finalization);
|
||||
_PyAsyncGen_ClearFreeLists(state, is_finalization);
|
||||
// Only be cleared if is_finalization is true.
|
||||
_PyObjectStackChunk_ClearFreeList(state, is_finalization);
|
||||
_PySlice_ClearFreeList(state, is_finalization);
|
||||
}
|
||||
|
||||
/*
|
||||
def _PyObject_FunctionStr(x):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue