| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
This looks right, but I'm still seeing issues with the test that uncovered the problem. I'll investigate more today.
Sorry, something went wrong.
There was a problem hiding this comment.
I'm still looking at _Py_dict_lookup, but I think insertdict and dict_setdefault_ref_lock_held can be simpler if they handle split dictionaries early on and separate from the main code path.
Sorry, something went wrong.
…sertdict and setdefault
There was a problem hiding this comment.
LGTM other than the unused code warning in the default build
Sorry, something went wrong.
| } | ||
|
|
||
| static Py_ssize_t | ||
| unicodekeys_lookup_unicode_threadsafe(PyDictKeysObject* dk, PyObject *key, |
There was a problem hiding this comment.
Unused code warning
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
_Py_dict_lookup needs to lock the shared keys if we have a split dictionary. If we're looking up with a non-exact unicode we need to also incref the keys as the lookup could mutate the keys and we could lose the last reference.
insertdict is updated to avoid contention on the shared dict lookup by calling the threadsafe unicode lookup directly and only falling back to _Py_dict_lookup if the thread safe lookup can't succeed.