summaryrefslogtreecommitdiffstats
path: root/Python/pystate.c
diff options
context:
space:
mode:
authorDonghee Na <donghee.na@python.org>2024-01-18 18:15:00 (GMT)
committerGitHub <noreply@github.com>2024-01-18 18:15:00 (GMT)
commit7fa511ba576b9a760f3971ad16dbbbbf91c3f39c (patch)
treed3e5fa9dd914d10f6f018bc728664635419ecb32 /Python/pystate.c
parent2d3f6b56c5846df60b0b305e51a1d293ba0b2aae (diff)
downloadcpython-7fa511ba576b9a760f3971ad16dbbbbf91c3f39c.zip
cpython-7fa511ba576b9a760f3971ad16dbbbbf91c3f39c.tar.gz
cpython-7fa511ba576b9a760f3971ad16dbbbbf91c3f39c.tar.bz2
gh-111968: Use per-thread freelists for generator in free-threading (gh-114189)
Diffstat (limited to 'Python/pystate.c')
-rw-r--r--Python/pystate.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Python/pystate.c b/Python/pystate.c
index 8374223..9999762 100644
--- a/Python/pystate.c
+++ b/Python/pystate.c
@@ -1462,6 +1462,7 @@ _Py_ClearFreeLists(_PyFreeListState *state, int is_finalization)
_PyTuple_ClearFreeList(state, is_finalization);
_PyList_ClearFreeList(state, is_finalization);
_PyContext_ClearFreeList(state, is_finalization);
+ _PyAsyncGen_ClearFreeLists(state, is_finalization);
}
void
@@ -1549,7 +1550,7 @@ PyThreadState_Clear(PyThreadState *tstate)
#ifdef Py_GIL_DISABLED
// Each thread should clear own freelists in free-threading builds.
_PyFreeListState *freelist_state = &((_PyThreadStateImpl*)tstate)->freelist_state;
- _Py_ClearFreeLists(freelist_state, 0);
+ _Py_ClearFreeLists(freelist_state, 1);
_PySlice_ClearCache(freelist_state);
#endif