summaryrefslogtreecommitdiffstats
path: root/Python/pylifecycle.c
diff options
context:
space:
mode:
authorSam Gross <colesbury@gmail.com>2024-07-22 16:08:27 (GMT)
committerGitHub <noreply@github.com>2024-07-22 16:08:27 (GMT)
commit5716cc352940a5f8557a8191e873837aa619498a (patch)
treea9b1526a46acfe002950b9ad0d046f03c7cab5e9 /Python/pylifecycle.c
parent2408a8a22bd13d8f15172a2ecf8bbbc4355dcb3b (diff)
downloadcpython-5716cc352940a5f8557a8191e873837aa619498a.zip
cpython-5716cc352940a5f8557a8191e873837aa619498a.tar.gz
cpython-5716cc352940a5f8557a8191e873837aa619498a.tar.bz2
gh-100240: Use a consistent implementation for freelists (#121934)
This combines and updates our freelist handling to use a consistent implementation. Objects in the freelist are linked together using the first word of memory block. If configured with freelists disabled, these operations are essentially no-ops.
Diffstat (limited to 'Python/pylifecycle.c')
-rw-r--r--Python/pylifecycle.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c
index 39eaa86..6b641c0 100644
--- a/Python/pylifecycle.c
+++ b/Python/pylifecycle.c
@@ -9,6 +9,7 @@
#include "pycore_dict.h" // _PyDict_Fini()
#include "pycore_exceptions.h" // _PyExc_InitTypes()
#include "pycore_fileutils.h" // _Py_ResetForceASCII()
+#include "pycore_freelist.h" // _PyObject_ClearFreeLists()
#include "pycore_floatobject.h" // _PyFloat_InitTypes()
#include "pycore_global_objects_fini_generated.h" // "_PyStaticObjects_CheckRefcnt()
#include "pycore_import.h" // _PyImport_BootstrapImp()
@@ -1843,7 +1844,7 @@ finalize_interp_types(PyInterpreterState *interp)
#ifndef Py_GIL_DISABLED
// With Py_GIL_DISABLED:
// the freelists for the current thread state have already been cleared.
- struct _Py_object_freelists *freelists = _Py_object_freelists_GET();
+ struct _Py_freelists *freelists = _Py_freelists_GET();
_PyObject_ClearFreeLists(freelists, 1);
#endif