summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorDonghee Na <donghee.na@python.org>2024-01-10 15:47:13 (GMT)
committerGitHub <noreply@github.com>2024-01-10 15:47:13 (GMT)
commitf728f7242c6008a16daaa5dde8e1db786857c50e (patch)
tree5e6dd8e921e432c9de0b0d8f60805ec03a8584eb /Python
parenta0c9cf9456c2ee7a89d9bd859c07afac8cf5e893 (diff)
downloadcpython-f728f7242c6008a16daaa5dde8e1db786857c50e.zip
cpython-f728f7242c6008a16daaa5dde8e1db786857c50e.tar.gz
cpython-f728f7242c6008a16daaa5dde8e1db786857c50e.tar.bz2
gh-111968: Use per-thread freelists for float in free-threading (gh-113886)
Diffstat (limited to 'Python')
-rw-r--r--Python/gc_free_threading.c1
-rw-r--r--Python/gc_gil.c1
-rw-r--r--Python/pylifecycle.c2
-rw-r--r--Python/pystate.c1
4 files changed, 2 insertions, 3 deletions
diff --git a/Python/gc_free_threading.c b/Python/gc_free_threading.c
index aea2728..c19893a 100644
--- a/Python/gc_free_threading.c
+++ b/Python/gc_free_threading.c
@@ -15,7 +15,6 @@ void
_PyGC_ClearAllFreeLists(PyInterpreterState *interp)
{
_PyTuple_ClearFreeList(interp);
- _PyFloat_ClearFreeList(interp);
_PyDict_ClearFreeList(interp);
_PyAsyncGen_ClearFreeLists(interp);
_PyContext_ClearFreeList(interp);
diff --git a/Python/gc_gil.c b/Python/gc_gil.c
index b0961cd..c8ca397 100644
--- a/Python/gc_gil.c
+++ b/Python/gc_gil.c
@@ -12,7 +12,6 @@ void
_PyGC_ClearAllFreeLists(PyInterpreterState *interp)
{
_PyTuple_ClearFreeList(interp);
- _PyFloat_ClearFreeList(interp);
_PyDict_ClearFreeList(interp);
_PyAsyncGen_ClearFreeLists(interp);
_PyContext_ClearFreeList(interp);
diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c
index bd6475f..6468e72 100644
--- a/Python/pylifecycle.c
+++ b/Python/pylifecycle.c
@@ -1757,10 +1757,10 @@ finalize_interp_types(PyInterpreterState *interp)
_PySlice_Fini(interp);
_PyUnicode_Fini(interp);
- _PyFloat_Fini(interp);
_PyFreeListState *state = _PyFreeListState_GET();
_PyList_Fini(state);
+ _PyFloat_Fini(state);
#ifdef Py_DEBUG
_PyStaticObjects_CheckRefcnt(interp);
diff --git a/Python/pystate.c b/Python/pystate.c
index ddd57f7..683e292 100644
--- a/Python/pystate.c
+++ b/Python/pystate.c
@@ -1458,6 +1458,7 @@ clear_datastack(PyThreadState *tstate)
void
_Py_ClearFreeLists(_PyFreeListState *state, int is_finalization)
{
+ _PyFloat_ClearFreeList(state, is_finalization);
_PyList_ClearFreeList(state, is_finalization);
}