Add a new private version to the builtin dict type

Issue #26058: Add a new private version to the builtin dict type, incremented
at each dictionary creation and at each dictionary change.

Implementation of the PEP 509.
This commit is contained in:
Victor Stinner 2016-09-08 12:51:24 -07:00
parent 70897ec54c
commit 3b6a6b4215
8 changed files with 243 additions and 4 deletions

View file

@ -26,6 +26,10 @@ typedef struct {
/* Number of items in the dictionary */
Py_ssize_t ma_used;
/* Dictionary version: globally unique, value change each time
the dictionary is modified */
uint64_t ma_version_tag;
PyDictKeysObject *ma_keys;
/* If ma_values is NULL, the table is "combined": keys and values