mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
gh-112075: Iterating a dict shouldn't require locks (#115108)
Makes iteration of a dict be lock free for the forward iteration case.
This commit is contained in:
parent
a3859422d1
commit
1002fbe12e
2 changed files with 267 additions and 62 deletions
|
|
@ -212,6 +212,7 @@ static inline PyDictUnicodeEntry* DK_UNICODE_ENTRIES(PyDictKeysObject *dk) {
|
|||
#define DICT_WATCHER_AND_MODIFICATION_MASK ((1 << (DICT_MAX_WATCHERS + DICT_WATCHED_MUTATION_BITS)) - 1)
|
||||
|
||||
#define DICT_VALUES_SIZE(values) ((uint8_t *)values)[-1]
|
||||
#define DICT_VALUES_USED_SIZE(values) ((uint8_t *)values)[-2]
|
||||
|
||||
#ifdef Py_GIL_DISABLED
|
||||
#define DICT_NEXT_VERSION(INTERP) \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue