MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / hash

Method hash

deps/concurrentqueue/concurrentqueue.h:436–447  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

434
435 template<bool use32> struct _hash_32_or_64 {
436 static inline std::uint32_t hash(std::uint32_t h)
437 {
438 // MurmurHash3 finalizer -- see https://code.google.com/p/smhasher/source/browse/trunk/MurmurHash3.cpp
439 // Since the thread ID is already unique, all we really want to do is propagate that
440 // uniqueness evenly across all the bits, so that we can use a subset of the bits while
441 // reducing collisions significantly
442 h ^= h >> 16;
443 h *= 0x85ebca6b;
444 h ^= h >> 13;
445 h *= 0xc2b2ae35;
446 return h ^ (h >> 16);
447 }
448 };
449 template<> struct _hash_32_or_64<1> {
450 static inline std::uint64_t hash(std::uint64_t h)

Callers 6

ckh_isearchFunction · 0.45
ckh_evict_reloc_insertFunction · 0.45
ckh_try_insertFunction · 0.45
ckh_isearchFunction · 0.45
ckh_evict_reloc_insertFunction · 0.45
ckh_try_insertFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected