gh-111968: Use per-thread slice_cache in free-threading#113972
Conversation
| struct _Py_tuple_state tuple_state; | ||
| struct _Py_list_state list_state; | ||
| struct _Py_slice_state slice_state; | ||
| } _PyFreeListState; |
There was a problem hiding this comment.
@erlend-aasland @colesbury
IMO, we should rename _PyFreeListState if we consider slice_cache is not freelist :)
Do you have any good suggestion?
There was a problem hiding this comment.
It's basically a freelist of max-length 1 🤷
There was a problem hiding this comment.
In that case, let's maintain the current naming. (Changing is quite stressful)
| } | ||
|
|
||
| void _PySlice_Fini(PyInterpreterState *interp) | ||
| void _PySlice_Fini(_PyFreeListState *state) |
There was a problem hiding this comment.
This is identical to _PySlice_ClearCache. Do we need both functions? If you want to keep both names, maybe have one call the other.
There was a problem hiding this comment.
Let's keep both names; I don't want to confuse people who work on the default build.
| struct _Py_tuple_state tuple_state; | ||
| struct _Py_list_state list_state; | ||
| struct _Py_slice_state slice_state; | ||
| } _PyFreeListState; |
There was a problem hiding this comment.
It's basically a freelist of max-length 1 🤷
|
I'll defer to Sam; please take his comments into account :) |
--disable-gilbuilds #111968