Set bit 0 ~ nbit-1 of |array| to be 0
| 44 | |
| 45 | // Set bit 0 ~ nbit-1 of |array| to be 0 |
| 46 | inline 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 |
| 56 | inline void bit_array_set(uint64_t* array, size_t i) { |
no outgoing calls
no test coverage detected