MCPcopy Create free account
hub / github.com/apache/arrow / LeastSignificantBitMask

Function LeastSignificantBitMask

cpp/src/arrow/util/bit_util.h:81–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

79// otherwise `[0, 8*sizof(Uint)[`
80template <typename Uint, bool kAllowUpperBound = false>
81constexpr auto LeastSignificantBitMask(Uint bit_index) {
82 if constexpr (kAllowUpperBound) {
83 if (bit_index == 8 * sizeof(Uint)) {
84 return ~Uint{0};
85 }
86 }
87 return (Uint{1} << bit_index) - Uint{1};
88}
89
90// Returns 'value' rounded up to the nearest multiple of 'factor'
91constexpr int64_t RoundUp(int64_t value, int64_t factor) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected