diff options
author | Eric Snow <ericsnowcurrently@gmail.com> | 2015-05-30 04:21:39 (GMT) |
---|---|---|
committer | Eric Snow <ericsnowcurrently@gmail.com> | 2015-05-30 04:21:39 (GMT) |
commit | 47db71756dc46873752166d35d4b8d00d09c8c5f (patch) | |
tree | e914661584cd3c21109269f757efc2a50e3b5f33 /Objects/dict-common.h | |
parent | 3979323ca3c6e51a194ece6d9d21b2f26a392f62 (diff) | |
download | cpython-47db71756dc46873752166d35d4b8d00d09c8c5f.zip cpython-47db71756dc46873752166d35d4b8d00d09c8c5f.tar.gz cpython-47db71756dc46873752166d35d4b8d00d09c8c5f.tar.bz2 |
Issue #16991: Add a C implementation of collections.OrderedDict.
Diffstat (limited to 'Objects/dict-common.h')
-rw-r--r-- | Objects/dict-common.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/Objects/dict-common.h b/Objects/dict-common.h new file mode 100644 index 0000000..2912eb9 --- /dev/null +++ b/Objects/dict-common.h @@ -0,0 +1,22 @@ +#ifndef Py_DICT_COMMON_H +#define Py_DICT_COMMON_H + +typedef struct { + /* Cached hash code of me_key. */ + Py_hash_t me_hash; + PyObject *me_key; + PyObject *me_value; /* This field is only meaningful for combined tables */ +} PyDictKeyEntry; + +typedef PyDictKeyEntry *(*dict_lookup_func) +(PyDictObject *mp, PyObject *key, Py_hash_t hash, PyObject ***value_addr); + +struct _dictkeysobject { + Py_ssize_t dk_refcnt; + Py_ssize_t dk_size; + dict_lookup_func dk_lookup; + Py_ssize_t dk_usable; + PyDictKeyEntry dk_entries[1]; +}; + +#endif |