mirror of
https://github.com/python/cpython.git
synced 2025-07-08 03:45:36 +00:00
gh-124296: Remove private dictionary version tag (PEP 699) (#124472)
This commit is contained in:
parent
60ff67d010
commit
5aa91c56bf
13 changed files with 35 additions and 354 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue