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

Function bitmap_clz

ccan/ccan/bitmap/bitmap.c:62–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60}
61
62static int bitmap_clz(bitmap_word w)
63{
64#if HAVE_BUILTIN_CLZL
65 return __builtin_clzl(w);
66#else
67 int lz = 0;
68 bitmap_word mask = (bitmap_word)1 << (BITMAP_WORD_BITS - 1);
69
70 while (!(w & mask)) {
71 lz++;
72 mask >>= 1;
73 }
74
75 return lz;
76#endif
77}
78
79unsigned long bitmap_ffs(const bitmap *b,
80 unsigned long n, unsigned long m)

Callers 1

bitmap_ffsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected