summaryrefslogtreecommitdiffstats
path: root/Objects/dict-common.h
diff options
context:
space:
mode:
authorEric Snow <ericsnowcurrently@gmail.com>2015-05-30 04:21:39 (GMT)
committerEric Snow <ericsnowcurrently@gmail.com>2015-05-30 04:21:39 (GMT)
commit96c6af9b207c188c52ac53ce87bb7f2dea3f328b (patch)
treec556c00510282cac20410e324505ff5b257874c6 /Objects/dict-common.h
parent0a3297d7d4e042d8fbb884a029f0ef7ad8b00e46 (diff)
downloadcpython-96c6af9b207c188c52ac53ce87bb7f2dea3f328b.zip
cpython-96c6af9b207c188c52ac53ce87bb7f2dea3f328b.tar.gz
cpython-96c6af9b207c188c52ac53ce87bb7f2dea3f328b.tar.bz2
Issue #16991: Add a C implementation of collections.OrderedDict.
Diffstat (limited to 'Objects/dict-common.h')
-rw-r--r--Objects/dict-common.h22
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