From b4e85cadfbc2b1b24ec5f3159e351dbacedaa5e0 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Tue, 23 Jun 2020 11:33:18 +0200 Subject: bpo-40521: Make dict free lists per-interpreter (GH-20645) Each interpreter now has its own dict free list: * Move dict free lists into PyInterpreterState. * Move PyDict_MAXFREELIST define to pycore_interp.h * Add _Py_dict_state structure. * Add tstate parameter to _PyDict_ClearFreeList() and _PyDict_Fini(). * In debug mode, ensure that the dict free lists are not used after _PyDict_Fini() is called. * Remove "#ifdef EXPERIMENTAL_ISOLATED_SUBINTERPRETERS". --- Python/pylifecycle.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'Python/pylifecycle.c') diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index 87f25e623f5..1b4a3db517c 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -1258,9 +1258,7 @@ finalize_interp_types(PyThreadState *tstate, int is_main_interp) if (is_main_interp) { _PySet_Fini(); } - if (is_main_interp) { - _PyDict_Fini(); - } + _PyDict_Fini(tstate); _PyList_Fini(tstate); _PyTuple_Fini(tstate); -- cgit v1.2.3