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

Function update_common

ccan/ccan/htable/htable.c:359–376  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

357
358/* We stole some bits, now we need to put them back... */
359static COLD void update_common(struct htable *ht, const void *p)
360{
361 uintptr_t maskdiff;
362
363 if (ht->elems == 0) {
364 ht->common_mask = -1;
365 ht->common_bits = ((uintptr_t)p & ht->common_mask);
366 ht->perfect_bitnum = 0;
367 (void)htable_debug(ht, HTABLE_LOC);
368 return;
369 }
370
371 /* Find bits which are unequal to old common set. */
372 maskdiff = ht->common_bits ^ ((uintptr_t)p & ht->common_mask);
373
374 fixup_table_common(ht, maskdiff);
375 (void)htable_debug(ht, HTABLE_LOC);
376}
377
378bool htable_add_(struct htable *ht, size_t hash, const void *p)
379{

Callers 2

htable_add_Function · 0.85
mainFunction · 0.85

Calls 1

fixup_table_commonFunction · 0.85

Tested by

no test coverage detected