gh-111968: Refactor _PyXXX_Fini to integrate with _PyObject_ClearFreeLists (gh-114899)

This commit is contained in:
Donghee Na 2024-02-10 09:57:04 +09:00 committed by GitHub
parent 564385612c
commit d4d5bae147
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 38 additions and 107 deletions

View file

@ -103,8 +103,11 @@ PyObject _Py_EllipsisObject = _PyObject_HEAD_INIT(&PyEllipsis_Type);
/* Slice object implementation */
void _PySlice_ClearCache(_PyFreeListState *state)
void _PySlice_ClearFreeList(_PyFreeListState *state, int is_finalization)
{
if (!is_finalization) {
return;
}
#ifdef WITH_FREELISTS
PySliceObject *obj = state->slices.slice_cache;
if (obj != NULL) {
@ -114,13 +117,6 @@ void _PySlice_ClearCache(_PyFreeListState *state)
#endif
}
void _PySlice_Fini(_PyFreeListState *state)
{
#ifdef WITH_FREELISTS
_PySlice_ClearCache(state);
#endif
}
/* start, stop, and step are python objects with None indicating no
index is present.
*/