aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python/context.c
diff options
context:
space:
mode:
authorDonghee Na <donghee.na@python.org>2024-02-16 10:01:36 +0900
committerGitHub <noreply@github.com>2024-02-16 01:01:36 +0000
commit321d13fd2b858d76cd4cbd03e6d8c4cba307449e (patch)
treefa0dca34a9aad53cb6b156c88cae5872c77987e8 /Python/context.c
parent454d7963e31cded1de3a90642da7259848efd232 (diff)
downloadcpython-321d13fd2b858d76cd4cbd03e6d8c4cba307449e.tar.gz
cpython-321d13fd2b858d76cd4cbd03e6d8c4cba307449e.zip
gh-111968: Split _Py_dictkeys_freelist out of _Py_dict_freelist (gh-115505)
Diffstat (limited to 'Python/context.c')
-rw-r--r--Python/context.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/Python/context.c b/Python/context.c
index 01a21b47da5..3937819b3c3 100644
--- a/Python/context.c
+++ b/Python/context.c
@@ -344,8 +344,8 @@ _context_alloc(void)
struct _Py_context_freelist *context_freelist = get_context_freelist();
if (context_freelist->numfree > 0) {
context_freelist->numfree--;
- ctx = context_freelist->freelist;
- context_freelist->freelist = (PyContext *)ctx->ctx_weakreflist;
+ ctx = context_freelist->items;
+ context_freelist->items = (PyContext *)ctx->ctx_weakreflist;
OBJECT_STAT_INC(from_freelist);
ctx->ctx_weakreflist = NULL;
_Py_NewReference((PyObject *)ctx);
@@ -471,8 +471,8 @@ context_tp_dealloc(PyContext *self)
struct _Py_context_freelist *context_freelist = get_context_freelist();
if (context_freelist->numfree >= 0 && context_freelist->numfree < PyContext_MAXFREELIST) {
context_freelist->numfree++;
- self->ctx_weakreflist = (PyObject *)context_freelist->freelist;
- context_freelist->freelist = self;
+ self->ctx_weakreflist = (PyObject *)context_freelist->items;
+ context_freelist->items = self;
OBJECT_STAT_INC(to_freelist);
}
else
@@ -1272,8 +1272,8 @@ _PyContext_ClearFreeList(struct _Py_object_freelists *freelists, int is_finaliza
#ifdef WITH_FREELISTS
struct _Py_context_freelist *state = &freelists->contexts;
for (; state->numfree > 0; state->numfree--) {
- PyContext *ctx = state->freelist;
- state->freelist = (PyContext *)ctx->ctx_weakreflist;
+ PyContext *ctx = state->items;
+ state->items = (PyContext *)ctx->ctx_weakreflist;
ctx->ctx_weakreflist = NULL;
PyObject_GC_Del(ctx);
}