mirror of
https://github.com/python/cpython.git
synced 2025-08-23 18:24:46 +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
4
Python/executor_cases.c.h
generated
4
Python/executor_cases.c.h
generated
|
@ -2625,7 +2625,6 @@
|
|||
JUMP_TO_JUMP_TARGET();
|
||||
}
|
||||
PyObject *old_value;
|
||||
uint64_t new_version;
|
||||
if (!DK_IS_UNICODE(dict->ma_keys)) {
|
||||
UOP_STAT_INC(uopcode, miss);
|
||||
JUMP_TO_JUMP_TARGET();
|
||||
|
@ -2641,9 +2640,8 @@
|
|||
}
|
||||
old_value = ep->me_value;
|
||||
PyDict_WatchEvent event = old_value == NULL ? PyDict_EVENT_ADDED : PyDict_EVENT_MODIFIED;
|
||||
new_version = _PyDict_NotifyEvent(tstate->interp, event, dict, name, PyStackRef_AsPyObjectBorrow(value));
|
||||
_PyDict_NotifyEvent(tstate->interp, event, dict, name, PyStackRef_AsPyObjectBorrow(value));
|
||||
ep->me_value = PyStackRef_AsPyObjectSteal(value);
|
||||
dict->ma_version_tag = new_version; // PEP 509
|
||||
// old_value should be DECREFed after GC track checking is done, if not, it could raise a segmentation fault,
|
||||
// when dict only holds the strong reference to value in ep->me_value.
|
||||
Py_XDECREF(old_value);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue