MCPcopy Create free account
hub / github.com/ElementsProject/lightning / get_hash_ptr_bits

Function get_hash_ptr_bits

ccan/ccan/htable/htable.c:69–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67}
68
69static inline uintptr_t get_hash_ptr_bits(const struct htable *ht,
70 size_t hash)
71{
72 /* Shuffling the extra bits (as specified in mask) down the
73 * end is quite expensive. But the lower bits are redundant, so
74 * we fold the value first. */
75 return (hash ^ (hash >> ht->bits))
76 & ht->common_mask & ~ht_perfect_mask(ht);
77}
78
79void htable_init(struct htable *ht,
80 size_t (*rehash)(const void *elem, void *priv), void *priv)

Callers 2

htable_valFunction · 0.85
ht_addFunction · 0.85

Calls 1

ht_perfect_maskFunction · 0.85

Tested by

no test coverage detected