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

Function update_common

ccan/ccan/htable/htable.c:371–388  ·  view source on GitHub ↗

We stole some bits, now we need to put them back... */

Source from the content-addressed store, hash-verified

369
370/* We stole some bits, now we need to put them back... */
371static COLD void update_common(struct htable *ht, const void *p)
372{
373 uintptr_t maskdiff;
374
375 if (ht->elems == 0) {
376 ht->common_mask = -1;
377 ht->common_bits = ((uintptr_t)p & ht->common_mask);
378 ht->perfect_bitnum = 0;
379 (void)htable_debug(ht, HTABLE_LOC);
380 return;
381 }
382
383 /* Find bits which are unequal to old common set. */
384 maskdiff = ht->common_bits ^ ((uintptr_t)p & ht->common_mask);
385
386 fixup_table_common(ht, maskdiff);
387 (void)htable_debug(ht, HTABLE_LOC);
388}
389
390bool htable_add_(struct htable *ht, size_t hash, const void *p)
391{

Callers 2

htable_add_Function · 0.85
mainFunction · 0.85

Calls 1

fixup_table_commonFunction · 0.85

Tested by

no test coverage detected