diff options
author | Donghee Na <donghee.na@python.org> | 2024-02-01 20:53:53 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-01 20:53:53 (GMT) |
commit | 13907968d73b3b602c81e240fb7892a2627974d6 (patch) | |
tree | 1113a242a55c14484f81d0997a167cacc5e42da1 /Python/pystate.c | |
parent | 587d4802034749e2aace9c00b00bd73eccdae1e7 (diff) | |
download | cpython-13907968d73b3b602c81e240fb7892a2627974d6.zip cpython-13907968d73b3b602c81e240fb7892a2627974d6.tar.gz cpython-13907968d73b3b602c81e240fb7892a2627974d6.tar.bz2 |
gh-111968: Use per-thread freelists for dict in free-threading (gh-114323)
Diffstat (limited to 'Python/pystate.c')
-rw-r--r-- | Python/pystate.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Python/pystate.c b/Python/pystate.c index 430121a..27b6d05 100644 --- a/Python/pystate.c +++ b/Python/pystate.c @@ -1461,9 +1461,12 @@ clear_datastack(PyThreadState *tstate) void _Py_ClearFreeLists(_PyFreeListState *state, int is_finalization) { + // In the free-threaded build, freelists are per-PyThreadState and cleared in PyThreadState_Clear() + // In the default build, freelists are per-interpreter and cleared in finalize_interp_types() _PyFloat_ClearFreeList(state, is_finalization); _PyTuple_ClearFreeList(state, is_finalization); _PyList_ClearFreeList(state, is_finalization); + _PyDict_ClearFreeList(state, is_finalization); _PyContext_ClearFreeList(state, is_finalization); _PyAsyncGen_ClearFreeLists(state, is_finalization); _PyObjectStackChunk_ClearFreeList(state, is_finalization); |