| 219 | static inline void SetBit(uint8_t* bits, int64_t i) { bits[i / 8] |= kBitmask[i % 8]; } |
| 220 | |
| 221 | static inline void SetBitTo(uint8_t* bits, int64_t i, bool bit_is_set) { |
| 222 | // https://graphics.stanford.edu/~seander/bithacks.html |
| 223 | // "Conditionally set or clear bits without branching" |
| 224 | // NOTE: this seems to confuse Valgrind as it reads from potentially |
| 225 | // uninitialized memory |
| 226 | bits[i / 8] ^= static_cast<uint8_t>(-static_cast<uint8_t>(bit_is_set) ^ bits[i / 8]) & |
| 227 | kBitmask[i % 8]; |
| 228 | } |
| 229 | |
| 230 | /// \brief set or clear a range of bits quickly |
| 231 | ARROW_EXPORT |
nothing calls this directly
no outgoing calls
no test coverage detected