Lines Matching defs:hash

5 // The reason we write our own hash map instead of using unordered_map in STL,
44 // initial_capacity is the size of the initial hash map;
66 Entry* Lookup(const Key& key, uint32_t hash) const;
70 // corresponding key, key hash, and default initialized value.
71 Entry* LookupOrInsert(const Key& key, uint32_t hash);
75 // corresponding key, key hash, and value created by func.
77 Entry* LookupOrInsert(const Key& key, uint32_t hash, const Func& value_func);
87 // a key created by key_func, key hash, and value created by
90 Entry* LookupOrInsert(const LookupKey& lookup_key, uint32_t hash,
93 Entry* InsertNew(const Key& key, uint32_t hash);
98 Value Remove(const Key& key, uint32_t hash);
100 // Empties the hash map (occupancy() == 0).
137 Entry* Probe(const LookupKey& key, uint32_t hash) const;
139 uint32_t hash);
144 // all internal state of the hash map and using private inheritance to store
215 const Key& key, uint32_t hash) const {
216 Entry* entry = Probe(key, hash);
224 const Key& key, uint32_t hash) {
225 return LookupOrInsert(key, hash, []() { return Value(); });
233 const Key& key, uint32_t hash, const Func& value_func) {
235 key, hash, [&key]() { return key; }, value_func);
243 const LookupKey& lookup_key, uint32_t hash, const KeyFunc& key_func,
246 Entry* entry = Probe(lookup_key, hash);
251 return FillEmptyEntry(entry, key_func(), value_func(), hash);
258 const Key& key, uint32_t hash) {
259 Entry* entry = Probe(key, hash);
260 return FillEmptyEntry(entry, key, Value(), hash);
266 const Key& key, uint32_t hash) {
268 Entry* p = Probe(key, hash);
308 Entry* r = impl_.map_ + (q->hash & (capacity() - 1));
362 const LookupKey& key, uint32_t hash) const {
364 size_t i = hash & (capacity() - 1);
370 !impl_.match()(hash, map[i].hash, key, map[i].key)) {
381 Entry* entry, const Key& key, const Value& value, uint32_t hash) {
384 new (entry) Entry(key, value, hash);
390 entry = Probe(key, hash);
423 Entry* new_entry = Probe(entry->key, entry->hash);
425 FillEmptyEntry(new_entry, entry->key, entry->value, entry->hash);
522 // A hash map for pointer keys and values with an STL-like interface.