MCPcopy Create free account
hub / github.com/apache/brpc / bit_array_clear

Function bit_array_clear

src/butil/bit_array.h:46–53  ·  view source on GitHub ↗

Set bit 0 ~ nbit-1 of |array| to be 0

Source from the content-addressed store, hash-verified

44
45// Set bit 0 ~ nbit-1 of |array| to be 0
46inline void bit_array_clear(uint64_t* array, size_t nbit) {
47 const size_t off = (nbit >> 6);
48 memset(array, 0, off * 8);
49 const size_t last = (off << 6);
50 if (last != nbit) {
51 array[off] &= ~((((uint64_t)1) << (nbit - last)) - 1);
52 }
53}
54
55// Set i-th bit (from left, counting from 0) of |array| to be 1
56inline void bit_array_set(uint64_t* array, size_t i) {

Callers 4

InitSupportedCommandMapFunction · 0.85
InitSupportedCommandMapFunction · 0.85
clearMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected