gh-124296: Remove private dictionary version tag (PEP 699) (#124472)

This commit is contained in:
Sam Gross 2024-10-01 12:39:56 -04:00 committed by GitHub
parent 60ff67d010
commit 5aa91c56bf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 35 additions and 354 deletions

View file

@ -56,14 +56,14 @@ static int
get_mutations(PyObject* dict) {
assert(PyDict_CheckExact(dict));
PyDictObject *d = (PyDictObject *)dict;
return (d->ma_version_tag >> DICT_MAX_WATCHERS) & ((1 << DICT_WATCHED_MUTATION_BITS)-1);
return (d->_ma_watcher_tag >> DICT_MAX_WATCHERS) & ((1 << DICT_WATCHED_MUTATION_BITS)-1);
}
static void
increment_mutations(PyObject* dict) {
assert(PyDict_CheckExact(dict));
PyDictObject *d = (PyDictObject *)dict;
d->ma_version_tag += (1 << DICT_MAX_WATCHERS);
d->_ma_watcher_tag += (1 << DICT_MAX_WATCHERS);
}
/* The first two dict watcher IDs are reserved for CPython,