GCC Code Coverage Report


Directory: cvmfs/
File: cvmfs/smallhash.h
Date: 2026-08-30 02:40:36
Exec Total Coverage
Lines: 259 263 98.5%
Branches: 85 110 77.3%

Line Branch Exec Source
1 /**
2 * This file is part of the CernVM File System.
3 */
4
5 #ifndef CVMFS_SMALLHASH_H_
6 #define CVMFS_SMALLHASH_H_
7
8 #include "duplex_testing.h"
9 #include <inttypes.h>
10 #include <pthread.h>
11 #include <stdint.h>
12
13 #include <algorithm>
14 #include <cassert>
15 #include <cstdlib>
16 #include <new>
17
18 #include "util/atomic.h"
19 #include "util/murmur.hxx"
20 #include "util/prng.h"
21 #include "util/smalloc.h"
22
23 /**
24 * Hash table with linear probing as collision resolution. Works only for
25 * a fixed (maximum) number of elements, i.e. no resizing. Load factor fixed
26 * to 0.7.
27 */
28 template<class Key, class Value, class Derived>
29 class SmallHashBase {
30 FRIEND_TEST(T_Smallhash, InsertAndCopyMd5Slow);
31
32 public:
33 static const double kLoadFactor; // mainly useless for the dynamic version
34 static const double kThresholdGrow; // only used for resizable version
35 static const double kThresholdShrink; // only used for resizable version
36
37 244762 SmallHashBase() {
38 244762 keys_ = NULL;
39 244762 values_ = NULL;
40 244762 hasher_ = NULL;
41 244762 bytes_allocated_ = 0;
42 244762 num_collisions_ = 0;
43 244762 max_collisions_ = 0;
44
45 // Properly initialized by Init()
46 244762 capacity_ = 0;
47 244762 initial_capacity_ = 0;
48 244762 size_ = 0;
49 244762 }
50
51 244624 ~SmallHashBase() { DeallocMemory(keys_, values_, capacity_); }
52
53 244702 void Init(uint32_t expected_size, Key empty,
54 uint32_t (*hasher)(const Key &key)) {
55 244702 hasher_ = hasher;
56 244702 empty_key_ = empty;
57 244702 capacity_ = static_cast<uint32_t>(static_cast<double>(expected_size)
58 244702 / kLoadFactor);
59 244702 initial_capacity_ = capacity_;
60 244702 static_cast<Derived *>(this)->SetThresholds(); // No-op for fixed size
61 244702 AllocMemory();
62 244702 this->DoClear(false);
63 244702 }
64
65 111882231 bool Lookup(const Key &key, Value *value) const {
66 uint32_t bucket;
67 uint32_t collisions;
68
1/2
✓ Branch 1 taken 111797649 times.
✗ Branch 2 not taken.
111882231 const bool found = DoLookup(key, &bucket, &collisions);
69
2/2
✓ Branch 0 taken 89502282 times.
✓ Branch 1 taken 22295367 times.
111945591 if (found)
70
1/2
✓ Branch 1 taken 81811 times.
✗ Branch 2 not taken.
89551557 *value = values_[bucket];
71 111945591 return found;
72 }
73
74 /**
75 * Returns both the key and the value. That is useful if Key's equality
76 * operator implements an equivalence relation on Key. In this case, LookupEx
77 * returns the key representing the equivalence class that has been used
78 * during Insert().
79 * Used to return a glue::InodeEx element when looking for an inode.
80 */
81 480 bool LookupEx(Key *key, Value *value) const {
82 480 uint32_t bucket = ScaleHash(*key);
83
2/2
✓ Branch 1 taken 160 times.
✓ Branch 2 taken 80 times.
480 while (!(keys_[bucket] == empty_key_)) {
84
1/2
✓ Branch 1 taken 160 times.
✗ Branch 2 not taken.
320 if (keys_[bucket] == *key) {
85 320 *key = keys_[bucket];
86 320 *value = values_[bucket];
87 320 return true;
88 }
89 bucket = (bucket + 1) % capacity_;
90 }
91 160 return false;
92 }
93
94 2067472 bool Contains(const Key &key) const {
95 uint32_t bucket;
96 uint32_t collisions;
97
1/2
✓ Branch 1 taken 2066737 times.
✗ Branch 2 not taken.
2067472 const bool found = DoLookup(key, &bucket, &collisions);
98 2067472 return found;
99 }
100
101 1725685940 void Insert(const Key &key, const Value &value) {
102 1725685940 static_cast<Derived *>(this)->Grow(); // No-op if fixed-size
103 1718855992 const bool overwritten = DoInsert(key, value, true);
104 1716546648 size_ += !overwritten; // size + 1 if the key was not yet in the map
105 1716546648 }
106
107 107742252 bool Erase(const Key &key) {
108 uint32_t bucket;
109 uint32_t collisions;
110
1/2
✓ Branch 1 taken 106474811 times.
✗ Branch 2 not taken.
107742252 const bool found = DoLookup(key, &bucket, &collisions);
111
1/2
✓ Branch 0 taken 106490448 times.
✗ Branch 1 not taken.
106478294 if (found) {
112 106493912 keys_[bucket] = empty_key_;
113 106493912 size_--;
114 106493912 bucket = (bucket + 1) % capacity_;
115
3/3
✓ Branch 0 taken 183235740 times.
✓ Branch 1 taken 103100987 times.
✓ Branch 2 taken 2597746 times.
288937937 while (!(keys_[bucket] == empty_key_)) {
116 183844395 Key rehash = keys_[bucket];
117 183844395 keys_[bucket] = empty_key_;
118
1/2
✓ Branch 1 taken 182444025 times.
✗ Branch 2 not taken.
183844395 DoInsert(rehash, values_[bucket], false);
119 182444025 bucket = (bucket + 1) % capacity_;
120 }
121
1/2
✓ Branch 1 taken 105893122 times.
✗ Branch 2 not taken.
105093542 static_cast<Derived *>(this)->Shrink(); // No-op if fixed-size
122 }
123 105924790 return found;
124 }
125
126 2057 void Clear() { DoClear(true); }
127
128 7364 uint64_t bytes_allocated() const { return bytes_allocated_; }
129 2025 static double GetEntrySize() {
130 4050 const double unit = sizeof(Key) + sizeof(Value);
131 4050 return unit / kLoadFactor;
132 }
133
134 void GetCollisionStats(uint64_t *num_collisions,
135 uint32_t *max_collisions) const {
136 *num_collisions = num_collisions_;
137 *max_collisions = max_collisions_;
138 }
139
140 // Careful with the direct access TODO: iterator
141 uint32_t capacity() const { return capacity_; }
142 271640 Key empty_key() const { return empty_key_; }
143 603544 Key *keys() const { return keys_; }
144 635 Value *values() const { return values_; }
145
146 // Only needed by compat
147 void SetHasher(uint32_t (*hasher)(const Key &key)) { hasher_ = hasher; }
148
149 protected:
150 2400221282 uint32_t ScaleHash(const Key &key) const {
151 2400221282 const double bucket = (static_cast<double>(hasher_(key))
152 2380336122 * static_cast<double>(capacity_)
153 / static_cast<double>(static_cast<uint32_t>(-1)));
154 2380336122 return static_cast<uint32_t>(bucket) % capacity_;
155 }
156
157 380646 void AllocMemory() {
158 380646 keys_ = static_cast<Key *>(smmap(capacity_ * sizeof(Key)));
159 380826 values_ = static_cast<Value *>(smmap(capacity_ * sizeof(Value)));
160
2/2
✓ Branch 0 taken 1347971789 times.
✓ Branch 1 taken 192468 times.
2685279032 for (uint32_t i = 0; i < capacity_; ++i) {
161 2684898266 /*keys_[i] =*/new (keys_ + i) Key();
162 }
163
2/2
✓ Branch 0 taken 1350581459 times.
✓ Branch 1 taken 247788 times.
2690609012 for (uint32_t i = 0; i < capacity_; ++i) {
164 2690117606 /*values_[i] =*/new (values_ + i) Value();
165 }
166 491406 bytes_allocated_ = (sizeof(Key) + sizeof(Value)) * capacity_;
167 491406 }
168
169 380688 void DeallocMemory(Key *k, Value *v, uint32_t c) {
170
2/2
✓ Branch 0 taken 1352377031 times.
✓ Branch 1 taken 192428 times.
2694092168 for (uint32_t i = 0; i < c; ++i) {
171 2693711480 k[i].~Key();
172 }
173
2/2
✓ Branch 0 taken 1350061001 times.
✓ Branch 1 taken 192428 times.
2689460108 for (uint32_t i = 0; i < c; ++i) {
174 2689079420 v[i].~Value();
175 }
176
1/2
✓ Branch 0 taken 192428 times.
✗ Branch 1 not taken.
380688 if (k)
177 380688 smunmap(k);
178
1/2
✓ Branch 0 taken 192428 times.
✗ Branch 1 not taken.
380688 if (v)
179 380688 smunmap(v);
180 380688 k = NULL;
181 380688 v = NULL;
182 380688 }
183
184 // Returns true iff the key is overwritten
185 2044021902 bool DoInsert(const Key &key, const Value &value,
186 const bool count_collisions) {
187 uint32_t bucket;
188 uint32_t collisions;
189
1/2
✓ Branch 1 taken 1061975159 times.
✗ Branch 2 not taken.
2044021902 const bool overwritten = DoLookup(key, &bucket, &collisions);
190
2/2
✓ Branch 0 taken 879697692 times.
✓ Branch 1 taken 182277467 times.
2042093726 if (count_collisions) {
191 1717173588 num_collisions_ += collisions;
192 1717173588 max_collisions_ = std::max(collisions, max_collisions_);
193 }
194 2041523950 keys_[bucket] = key;
195
1/2
✓ Branch 1 taken 39579595 times.
✗ Branch 2 not taken.
2041523950 values_[bucket] = value;
196 2041523950 return overwritten;
197 }
198
199 2410242034 bool DoLookup(const Key &key, uint32_t *bucket, uint32_t *collisions) const {
200 2410242034 *bucket = ScaleHash(key);
201 2378598970 *collisions = 0;
202
3/3
✓ Branch 0 taken 21679065693 times.
✓ Branch 1 taken 955635245 times.
✓ Branch 2 taken 194967153 times.
25015449546 while (!(keys_[*bucket] == empty_key_)) {
203
3/3
✓ Branch 0 taken 212026009 times.
✓ Branch 1 taken 21473754100 times.
✓ Branch 2 taken 95587369 times.
23002801488 if (keys_[*bucket] == key)
204 365950912 return true;
205 22636850576 *bucket = (*bucket + 1) % capacity_;
206 22636850576 (*collisions)++;
207 }
208 2012648058 return false;
209 }
210
211 380902 void DoClear(const bool reset_capacity) {
212
2/2
✓ Branch 0 taken 2057 times.
✓ Branch 1 taken 190517 times.
380902 if (reset_capacity)
213 3392 static_cast<Derived *>(this)->ResetCapacity(); // No-op if fixed-size
214
2/2
✓ Branch 0 taken 1350615359 times.
✓ Branch 1 taken 192574 times.
2690462568 for (uint32_t i = 0; i < capacity_; ++i)
215 2690081666 keys_[i] = empty_key_;
216 380902 size_ = 0;
217 380902 }
218
219 // Methods for resizable version
220 void SetThresholds() { }
221 void Grow() { }
222 void Shrink() { }
223 void ResetCapacity() { }
224
225 // Separate key and value arrays for better locality
226 Key *keys_;
227 Value *values_;
228 uint32_t capacity_;
229 uint32_t initial_capacity_;
230 uint32_t size_;
231 uint32_t (*hasher_)(const Key &key);
232 uint64_t bytes_allocated_;
233 uint64_t num_collisions_;
234 uint32_t max_collisions_; /**< maximum collisions for a single insert */
235 Key empty_key_;
236 };
237
238
239 template<class Key, class Value>
240 class SmallHashFixed
241 : public SmallHashBase<Key, Value, SmallHashFixed<Key, Value> > {
242 friend class SmallHashBase<Key, Value, SmallHashFixed<Key, Value> >;
243
244 protected:
245 // No-ops
246 7288 void SetThresholds() { }
247 827132 void Grow() { }
248 43822 void Shrink() { }
249 76 void ResetCapacity() { }
250 };
251
252
253 template<class Key, class Value>
254 class SmallHashDynamic
255 : public SmallHashBase<Key, Value, SmallHashDynamic<Key, Value> > {
256 friend class SmallHashBase<Key, Value, SmallHashDynamic<Key, Value> >;
257
258 public:
259 typedef SmallHashBase<Key, Value, SmallHashDynamic<Key, Value> > Base;
260 static const double kThresholdGrow;
261 static const double kThresholdShrink;
262
263 237474 SmallHashDynamic() : Base() {
264 237474 num_migrates_ = 0;
265
266 // Properly set by Init
267 237474 threshold_grow_ = 0;
268 237474 threshold_shrink_ = 0;
269 237474 }
270
271 SmallHashDynamic(const SmallHashDynamic<Key, Value> &other) : Base() {
272 num_migrates_ = 0;
273 CopyFrom(other);
274 }
275
276 46 SmallHashDynamic<Key, Value> &operator=(
277 const SmallHashDynamic<Key, Value> &other) {
278
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 38 times.
46 if (&other == this)
279 return *this;
280
281 46 CopyFrom(other);
282 46 return *this;
283 }
284
285 51198478 uint32_t capacity() const { return Base::capacity_; }
286 989257212 uint32_t size() const { return Base::size_; }
287 uint32_t num_migrates() const { return num_migrates_; }
288
289 protected:
290 373238 void SetThresholds() {
291 373238 threshold_grow_ = static_cast<uint32_t>(static_cast<double>(capacity())
292 373358 * kThresholdGrow);
293 373358 threshold_shrink_ = static_cast<uint32_t>(static_cast<double>(capacity())
294 373358 * kThresholdShrink);
295 373358 }
296
297 1722651810 void Grow() {
298
2/2
✓ Branch 1 taken 45714 times.
✓ Branch 2 taken 880266240 times.
1722651810 if (size() > threshold_grow_)
299 91428 Migrate(capacity() * 2);
300 1719270990 }
301
302 105959072 void Shrink() {
303
2/2
✓ Branch 1 taken 24702674 times.
✓ Branch 2 taken 81154990 times.
105959072 if (size() < threshold_shrink_) {
304 24706138 const uint32_t target_capacity = capacity() / 2;
305
2/2
✓ Branch 0 taken 20550 times.
✓ Branch 1 taken 24676946 times.
24700960 if (target_capacity >= Base::initial_capacity_)
306 20550 Migrate(target_capacity);
307 }
308 105856040 }
309
310 3316 void ResetCapacity() {
311 3316 Base::DeallocMemory(Base::keys_, Base::values_, Base::capacity_);
312 3316 Base::capacity_ = Base::initial_capacity_;
313 3316 Base::AllocMemory();
314 3316 SetThresholds();
315 3316 }
316
317 private:
318 // Returns a random permutation of indices [0..N-1] that is allocated
319 // by smmap (Knuth's shuffle algorithm)
320 41356 uint32_t *ShuffleIndices(const uint32_t N) {
321 41356 uint32_t *shuffled = static_cast<uint32_t *>(smmap(N * sizeof(uint32_t)));
322 // Init with identity
323
2/2
✓ Branch 0 taken 338514318 times.
✓ Branch 1 taken 20678 times.
677069992 for (unsigned i = 0; i < N; ++i)
324 677028636 shuffled[i] = i;
325 // Shuffle (no shuffling for the last element)
326
1/2
✓ Branch 0 taken 322344310 times.
✗ Branch 1 not taken.
644633676 for (unsigned i = 0; i < N - 1; ++i) {
327 644688620 const uint32_t swap_idx = i + g_prng.Next(N - i);
328 644592320 const uint32_t tmp = shuffled[i];
329 644592320 shuffled[i] = shuffled[swap_idx];
330 644592320 shuffled[swap_idx] = tmp;
331 }
332 46 return shuffled;
333 }
334
335 132468 void Migrate(const uint32_t new_capacity) {
336 132468 Key *old_keys = Base::keys_;
337 132468 Value *old_values = Base::values_;
338 132468 const uint32_t old_capacity = capacity();
339 132408 const uint32_t old_size = size();
340
341 132468 Base::capacity_ = new_capacity;
342 132468 SetThresholds();
343 132588 Base::AllocMemory();
344 132768 Base::DoClear(false);
345
2/2
✓ Branch 0 taken 20640 times.
✓ Branch 1 taken 45744 times.
132768 if (new_capacity < old_capacity) {
346 41280 uint32_t *shuffled_indices = ShuffleIndices(old_capacity);
347
1/2
✓ Branch 0 taken 290194140 times.
✗ Branch 1 not taken.
580378140 for (uint32_t i = 0; i < old_capacity; ++i) {
348
2/3
✓ Branch 0 taken 72806760 times.
✓ Branch 1 taken 217387380 times.
✗ Branch 2 not taken.
580388280 if (old_keys[shuffled_indices[i]] != Base::empty_key_) {
349 145613520 Base::Insert(old_keys[shuffled_indices[i]],
350 145613520 old_values[shuffled_indices[i]]);
351 }
352 }
353 smunmap(shuffled_indices);
354 } else {
355
1/2
✓ Branch 0 taken 547847442 times.
✗ Branch 1 not taken.
1095573372 for (uint32_t i = 0; i < old_capacity; ++i) {
356
3/3
✓ Branch 0 taken 314165164 times.
✓ Branch 1 taken 201399858 times.
✓ Branch 2 taken 32282420 times.
1095694884 if (old_keys[i] != Base::empty_key_)
357 822043816 Base::Insert(old_keys[i], old_values[i]);
358 }
359 }
360
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 66354 times.
4608 assert(size() == old_size);
361
362 132708 Base::DeallocMemory(old_keys, old_values, old_capacity);
363 132768 num_migrates_++;
364 132768 }
365
366 46 void CopyFrom(const SmallHashDynamic<Key, Value> &other) {
367 46 uint32_t *shuffled_indices = ShuffleIndices(other.capacity_);
368
2/2
✓ Branch 0 taken 41287848 times.
✓ Branch 1 taken 38 times.
41288062 for (uint32_t i = 0; i < other.capacity_; ++i) {
369
2/3
✗ Branch 0 not taken.
✓ Branch 1 taken 30000084 times.
✓ Branch 2 taken 11287764 times.
41288016 if (other.keys_[shuffled_indices[i]] != other.empty_key_) {
370 30000000 this->Insert(other.keys_[shuffled_indices[i]],
371 30000000 other.values_[shuffled_indices[i]]);
372 }
373 }
374 46 smunmap(shuffled_indices);
375 46 }
376
377 uint32_t num_migrates_;
378 uint32_t threshold_grow_;
379 uint32_t threshold_shrink_;
380 static Prng g_prng;
381 };
382
383
384 /**
385 * Distributes the key-value pairs over $n$ dynamic hash maps with individual
386 * mutexes. Hence low mutex contention, and benefits from multiple processors.
387 */
388 template<class Key, class Value>
389 class MultiHash {
390 public:
391 300 MultiHash() {
392 300 num_hashmaps_ = 0;
393 300 hashmaps_ = NULL;
394 300 locks_ = NULL;
395 300 }
396
397 300 void Init(const uint8_t num_hashmaps, const Key &empty_key,
398 uint32_t (*hasher)(const Key &key)) {
399
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 300 times.
300 assert(num_hashmaps > 0);
400 300 const uint8_t N = num_hashmaps;
401 300 num_hashmaps_ = N;
402
3/4
✓ Branch 2 taken 12600 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 12600 times.
✓ Branch 5 taken 300 times.
12900 hashmaps_ = new SmallHashDynamic<Key, Value>[N]();
403 300 locks_ = static_cast<pthread_mutex_t *>(
404 300 smalloc(N * sizeof(pthread_mutex_t)));
405
2/2
✓ Branch 0 taken 12600 times.
✓ Branch 1 taken 300 times.
12900 for (uint8_t i = 0; i < N; ++i) {
406 12600 int retval = pthread_mutex_init(&locks_[i], NULL);
407
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 12600 times.
12600 assert(retval == 0);
408 12600 hashmaps_[i].Init(128, empty_key, hasher);
409 }
410 300 }
411
412 300 ~MultiHash() {
413
2/2
✓ Branch 0 taken 12600 times.
✓ Branch 1 taken 300 times.
12900 for (uint8_t i = 0; i < num_hashmaps_; ++i) {
414 12600 pthread_mutex_destroy(&locks_[i]);
415 }
416 300 free(locks_);
417
3/4
✓ Branch 0 taken 300 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 12600 times.
✓ Branch 3 taken 300 times.
12900 delete[] hashmaps_;
418 300 }
419
420 30000000 bool Lookup(const Key &key, Value *value) {
421 30000000 uint8_t target = SelectHashmap(key);
422 30000000 Lock(target);
423 30000000 const bool result = hashmaps_[target].Lookup(key, value);
424 30000000 Unlock(target);
425 30000000 return result;
426 }
427
428 112004370 void Insert(const Key &key, const Value &value) {
429 112004370 uint8_t target = SelectHashmap(key);
430 108685410 Lock(target);
431 113357880 hashmaps_[target].Insert(key, value);
432 106703610 Unlock(target);
433 116812590 }
434
435 54728850 void Erase(const Key &key) {
436 54728850 uint8_t target = SelectHashmap(key);
437 52299300 Lock(target);
438 55752750 hashmaps_[target].Erase(key);
439 51142530 Unlock(target);
440 56579040 }
441
442 30 void Clear() {
443
2/2
✓ Branch 0 taken 1260 times.
✓ Branch 1 taken 30 times.
1290 for (uint8_t i = 0; i < num_hashmaps_; ++i)
444 1260 Lock(i);
445
2/2
✓ Branch 0 taken 1260 times.
✓ Branch 1 taken 30 times.
1290 for (uint8_t i = 0; i < num_hashmaps_; ++i)
446 1260 hashmaps_[i].Clear();
447
2/2
✓ Branch 0 taken 1260 times.
✓ Branch 1 taken 30 times.
1290 for (uint8_t i = 0; i < num_hashmaps_; ++i)
448 1260 Unlock(i);
449 30 }
450
451 300 uint8_t num_hashmaps() const { return num_hashmaps_; }
452
453 240 void GetSizes(uint32_t *sizes) {
454
2/2
✓ Branch 0 taken 10080 times.
✓ Branch 1 taken 240 times.
10320 for (uint8_t i = 0; i < num_hashmaps_; ++i) {
455 10080 Lock(i);
456 10080 sizes[i] = hashmaps_[i].size();
457 10080 Unlock(i);
458 }
459 240 }
460
461 void GetCollisionStats(uint64_t *num_collisions, uint32_t *max_collisions) {
462 for (uint8_t i = 0; i < num_hashmaps_; ++i) {
463 Lock(i);
464 hashmaps_[i].GetCollisionStats(&num_collisions[i], &max_collisions[i]);
465 Unlock(i);
466 }
467 }
468
469 private:
470 195154380 inline uint8_t SelectHashmap(const Key &key) {
471 195154380 uint32_t hash = MurmurHash2(&key, sizeof(key), 0x37);
472 191816940 double bucket = static_cast<double>(hash)
473 191816940 * static_cast<double>(num_hashmaps_)
474 / static_cast<double>(static_cast<uint32_t>(-1));
475 191816940 return static_cast<uint32_t>(bucket) % num_hashmaps_;
476 }
477
478 190294800 inline void Lock(const uint8_t target) {
479 190294800 int retval = pthread_mutex_lock(&locks_[target]);
480
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 205708800 times.
205708800 assert(retval == 0);
481 205708800 }
482
483 187725600 inline void Unlock(const uint8_t target) {
484 187725600 int retval = pthread_mutex_unlock(&locks_[target]);
485
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 206754000 times.
206754000 assert(retval == 0);
486 206754000 }
487
488 uint8_t num_hashmaps_;
489 SmallHashDynamic<Key, Value> *hashmaps_;
490 pthread_mutex_t *locks_;
491 };
492
493
494 // initialize the static fields
495 template<class Key, class Value>
496 Prng SmallHashDynamic<Key, Value>::g_prng;
497
498 template<class Key, class Value, class Derived>
499 const double SmallHashBase<Key, Value, Derived>::kLoadFactor = 0.75;
500
501 template<class Key, class Value>
502 const double SmallHashDynamic<Key, Value>::kThresholdGrow = 0.75;
503
504 template<class Key, class Value>
505 const double SmallHashDynamic<Key, Value>::kThresholdShrink = 0.25;
506
507 #endif // CVMFS_SMALLHASH_H_
508