diff options
author | Donghee Na <donghee.na@python.org> | 2024-01-26 15:25:16 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-26 15:25:16 (GMT) |
commit | 699779256ec4d4b8afb8211de08ef1382c78c370 (patch) | |
tree | 34b4bbdf255c6a4304dbb19399b28d5f6e351651 /Objects | |
parent | 504334c7be5a56237df2598d338cd494a42fca4c (diff) | |
download | cpython-699779256ec4d4b8afb8211de08ef1382c78c370.zip cpython-699779256ec4d4b8afb8211de08ef1382c78c370.tar.gz cpython-699779256ec4d4b8afb8211de08ef1382c78c370.tar.bz2 |
gh-111968: Unify freelist naming schema to Eric's suggestion (gh-114581)
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/floatobject.c | 4 | ||||
-rw-r--r-- | Objects/genobject.c | 4 | ||||
-rw-r--r-- | Objects/listobject.c | 4 | ||||
-rw-r--r-- | Objects/sliceobject.c | 14 | ||||
-rw-r--r-- | Objects/tupleobject.c | 2 |
5 files changed, 14 insertions, 14 deletions
diff --git a/Objects/floatobject.c b/Objects/floatobject.c index 912c450..b7611d5 100644 --- a/Objects/floatobject.c +++ b/Objects/floatobject.c @@ -32,7 +32,7 @@ get_float_state(void) { _PyFreeListState *state = _PyFreeListState_GET(); assert(state != NULL); - return &state->float_state; + return &state->floats; } #endif @@ -1993,7 +1993,7 @@ void _PyFloat_ClearFreeList(_PyFreeListState *freelist_state, int is_finalization) { #ifdef WITH_FREELISTS - struct _Py_float_state *state = &freelist_state->float_state; + struct _Py_float_state *state = &freelist_state->floats; PyFloatObject *f = state->free_list; while (f != NULL) { PyFloatObject *next = (PyFloatObject*) Py_TYPE(f); diff --git a/Objects/genobject.c b/Objects/genobject.c index e9aeb7a..f471973 100644 --- a/Objects/genobject.c +++ b/Objects/genobject.c @@ -1633,7 +1633,7 @@ static struct _Py_async_gen_state * get_async_gen_state(void) { _PyFreeListState *state = _PyFreeListState_GET(); - return &state->async_gen_state; + return &state->async_gens; } #endif @@ -1659,7 +1659,7 @@ void _PyAsyncGen_ClearFreeLists(_PyFreeListState *freelist_state, int is_finalization) { #ifdef WITH_FREELISTS - struct _Py_async_gen_state *state = &freelist_state->async_gen_state; + struct _Py_async_gen_state *state = &freelist_state->async_gens; while (state->value_numfree > 0) { _PyAsyncGenWrappedValue *o; diff --git a/Objects/listobject.c b/Objects/listobject.c index 401d102..1e885f9 100644 --- a/Objects/listobject.c +++ b/Objects/listobject.c @@ -26,7 +26,7 @@ get_list_state(void) { _PyFreeListState *state = _PyFreeListState_GET(); assert(state != NULL); - return &state->list_state; + return &state->lists; } #endif @@ -124,7 +124,7 @@ void _PyList_ClearFreeList(_PyFreeListState *freelist_state, int is_finalization) { #ifdef WITH_FREELISTS - struct _Py_list_state *state = &freelist_state->list_state; + struct _Py_list_state *state = &freelist_state->lists; while (state->numfree > 0) { PyListObject *op = state->free_list[--state->numfree]; assert(PyList_CheckExact(op)); diff --git a/Objects/sliceobject.c b/Objects/sliceobject.c index 440c1da..8b9d6bb 100644 --- a/Objects/sliceobject.c +++ b/Objects/sliceobject.c @@ -106,9 +106,9 @@ PyObject _Py_EllipsisObject = _PyObject_HEAD_INIT(&PyEllipsis_Type); void _PySlice_ClearCache(_PyFreeListState *state) { #ifdef WITH_FREELISTS - PySliceObject *obj = state->slice_state.slice_cache; + PySliceObject *obj = state->slices.slice_cache; if (obj != NULL) { - state->slice_state.slice_cache = NULL; + state->slices.slice_cache = NULL; PyObject_GC_Del(obj); } #endif @@ -132,9 +132,9 @@ _PyBuildSlice_Consume2(PyObject *start, PyObject *stop, PyObject *step) PySliceObject *obj; #ifdef WITH_FREELISTS _PyFreeListState *state = _PyFreeListState_GET(); - if (state->slice_state.slice_cache != NULL) { - obj = state->slice_state.slice_cache; - state->slice_state.slice_cache = NULL; + if (state->slices.slice_cache != NULL) { + obj = state->slices.slice_cache; + state->slices.slice_cache = NULL; _Py_NewReference((PyObject *)obj); } else @@ -370,8 +370,8 @@ slice_dealloc(PySliceObject *r) Py_DECREF(r->stop); #ifdef WITH_FREELISTS _PyFreeListState *state = _PyFreeListState_GET(); - if (state->slice_state.slice_cache == NULL) { - state->slice_state.slice_cache = r; + if (state->slices.slice_cache == NULL) { + state->slices.slice_cache = r; } else #endif diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c index e1b8e40..b9bf6cd 100644 --- a/Objects/tupleobject.c +++ b/Objects/tupleobject.c @@ -1125,7 +1125,7 @@ tuple_iter(PyObject *seq) * freelists * *************/ -#define STATE (state->tuple_state) +#define STATE (state->tuples) #define FREELIST_FINALIZED (STATE.numfree[0] < 0) static inline PyTupleObject * |