mirror of
https://github.com/python/cpython.git
synced 2025-07-23 03:05:38 +00:00
gh-111968: Use per-thread slice_cache in free-threading (gh-113972)
This commit is contained in:
parent
44e47dfba5
commit
3eae76554b
7 changed files with 28 additions and 18 deletions
|
@ -1752,15 +1752,13 @@ finalize_interp_types(PyInterpreterState *interp)
|
|||
_PyUnicode_ClearInterned(interp);
|
||||
|
||||
_PyDict_Fini(interp);
|
||||
|
||||
_PySlice_Fini(interp);
|
||||
|
||||
_PyUnicode_Fini(interp);
|
||||
|
||||
_PyFreeListState *state = _PyFreeListState_GET();
|
||||
_PyTuple_Fini(state);
|
||||
_PyList_Fini(state);
|
||||
_PyFloat_Fini(state);
|
||||
_PySlice_Fini(state);
|
||||
|
||||
#ifdef Py_DEBUG
|
||||
_PyStaticObjects_CheckRefcnt(interp);
|
||||
|
|
|
@ -1549,6 +1549,7 @@ PyThreadState_Clear(PyThreadState *tstate)
|
|||
// Each thread should clear own freelists in free-threading builds.
|
||||
_PyFreeListState *freelist_state = &((_PyThreadStateImpl*)tstate)->freelist_state;
|
||||
_Py_ClearFreeLists(freelist_state, 0);
|
||||
_PySlice_ClearCache(freelist_state);
|
||||
#endif
|
||||
|
||||
_PyThreadState_ClearMimallocHeaps(tstate);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue