mirror of
https://github.com/python/cpython.git
synced 2025-10-09 08:31:26 +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
|
@ -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.
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue