diff options
author | Dino Viehland <dinoviehland@meta.com> | 2024-02-22 20:02:39 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-22 20:02:39 (GMT) |
commit | 1002fbe12e0bd8c9a54bc5addbf5d94a5b35f91f (patch) | |
tree | 4e46fda10899aedc5691cf477177d363df910dbd /Include | |
parent | a3859422d15d98892fd53499916bd424f841404f (diff) | |
download | cpython-1002fbe12e0bd8c9a54bc5addbf5d94a5b35f91f.zip cpython-1002fbe12e0bd8c9a54bc5addbf5d94a5b35f91f.tar.gz cpython-1002fbe12e0bd8c9a54bc5addbf5d94a5b35f91f.tar.bz2 |
gh-112075: Iterating a dict shouldn't require locks (#115108)
Makes iteration of a dict be lock free for the forward iteration case.
Diffstat (limited to 'Include')
-rw-r--r-- | Include/internal/pycore_dict.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Include/internal/pycore_dict.h b/Include/internal/pycore_dict.h index 5a496d5..d1a0010 100644 --- a/Include/internal/pycore_dict.h +++ b/Include/internal/pycore_dict.h @@ -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) \ |