mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-111968: Rename freelist related struct names to Eric's suggestion (gh-115329)
This commit is contained in:
parent
518af37eb5
commit
f15795c9a0
19 changed files with 189 additions and 206 deletions
|
@ -103,15 +103,15 @@ PyObject _Py_EllipsisObject = _PyObject_HEAD_INIT(&PyEllipsis_Type);
|
|||
|
||||
/* Slice object implementation */
|
||||
|
||||
void _PySlice_ClearFreeList(_PyFreeListState *state, int is_finalization)
|
||||
void _PySlice_ClearFreeList(struct _Py_object_freelists *freelists, int is_finalization)
|
||||
{
|
||||
if (!is_finalization) {
|
||||
return;
|
||||
}
|
||||
#ifdef WITH_FREELISTS
|
||||
PySliceObject *obj = state->slices.slice_cache;
|
||||
PySliceObject *obj = freelists->slices.slice_cache;
|
||||
if (obj != NULL) {
|
||||
state->slices.slice_cache = NULL;
|
||||
freelists->slices.slice_cache = NULL;
|
||||
PyObject_GC_Del(obj);
|
||||
}
|
||||
#endif
|
||||
|
@ -127,10 +127,10 @@ _PyBuildSlice_Consume2(PyObject *start, PyObject *stop, PyObject *step)
|
|||
assert(start != NULL && stop != NULL && step != NULL);
|
||||
PySliceObject *obj;
|
||||
#ifdef WITH_FREELISTS
|
||||
_PyFreeListState *state = _PyFreeListState_GET();
|
||||
if (state->slices.slice_cache != NULL) {
|
||||
obj = state->slices.slice_cache;
|
||||
state->slices.slice_cache = NULL;
|
||||
struct _Py_object_freelists *freelists = _Py_object_freelists_GET();
|
||||
if (freelists->slices.slice_cache != NULL) {
|
||||
obj = freelists->slices.slice_cache;
|
||||
freelists->slices.slice_cache = NULL;
|
||||
_Py_NewReference((PyObject *)obj);
|
||||
}
|
||||
else
|
||||
|
@ -365,9 +365,9 @@ slice_dealloc(PySliceObject *r)
|
|||
Py_DECREF(r->start);
|
||||
Py_DECREF(r->stop);
|
||||
#ifdef WITH_FREELISTS
|
||||
_PyFreeListState *state = _PyFreeListState_GET();
|
||||
if (state->slices.slice_cache == NULL) {
|
||||
state->slices.slice_cache = r;
|
||||
struct _Py_object_freelists *freelists = _Py_object_freelists_GET();
|
||||
if (freelists->slices.slice_cache == NULL) {
|
||||
freelists->slices.slice_cache = r;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue