Lines Matching refs:hash_table
27 typedef HashTable<T*, Hash, Equal> hash_table; typedef
33 lru_lists_(new LRUList<T>[hash_table::nlocks_]) {
44 typename hash_table::Bucket& bucket = GetBucket(h); in Insert()
49 if (hash_table::Insert(&bucket, t)) { in Insert()
64 typename hash_table::Bucket& bucket = GetBucket(h); in Find()
69 if (hash_table::Find(&bucket, t, ret)) { in Find()
82 const size_t start_idx = random % hash_table::nlocks_;
86 for (size_t i = 0; !t && i < hash_table::nlocks_; ++i) {
87 const size_t idx = (start_idx + i) % hash_table::nlocks_;
89 WriteLock _(&hash_table::locks_[idx]);
95 typename hash_table::Bucket& bucket = GetBucket(h);
97 bool status = hash_table::Erase(&bucket, t, &tmp);
112 for (uint32_t i = 0; i < hash_table::nbuckets_; ++i) { in Clear()
113 const uint32_t lock_idx = i % hash_table::nlocks_; in Clear()
114 WriteLock _(&hash_table::locks_[lock_idx]); in Clear()
116 auto& bucket = hash_table::buckets_[i]; in Clear()
129 for (uint32_t i = 0; i < hash_table::nlocks_; ++i) { in AssertEmptyLRU()
130 WriteLock _(&hash_table::locks_[i]); in AssertEmptyLRU()
141 port::RWMutex* GetMutex(T* t) { return hash_table::GetMutex(t); } in GetMutex()
146 typename hash_table::Bucket& GetBucket(const uint64_t h) { in GetBucket()
147 const uint32_t bucket_idx = h % hash_table::nbuckets_; in GetBucket()
148 return hash_table::buckets_[bucket_idx]; in GetBucket()
152 const uint32_t bucket_idx = h % hash_table::nbuckets_; in GetLRUList()
153 const uint32_t lock_idx = bucket_idx % hash_table::nlocks_; in GetLRUList()
158 const uint32_t bucket_idx = h % hash_table::nbuckets_; in GetMutex()
159 const uint32_t lock_idx = bucket_idx % hash_table::nlocks_; in GetMutex()
160 return hash_table::locks_[lock_idx]; in GetMutex()