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

Function CoveringBytes

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

Returns the number of bytes covering a sliced bitmap. Find the length rounded to cover full bytes on both extremities. The following example represents a slice (offset=10, length=9) 0 8 16 24 |-------|-------|------| [ ] (slice) [ ] (same slice aligned to bytes bounds, length=16) The covering bytes is the length (in bytes) of this new aligned slic

Source from the content-addressed store, hash-verified

127//
128// The covering bytes is the length (in bytes) of this new aligned slice.
129constexpr int64_t CoveringBytes(int64_t offset, int64_t length) {
130 return (bit_util::RoundUp(length + offset, 8) - bit_util::RoundDown(offset, 8)) / 8;
131}
132
133// Returns the 'num_bits' least-significant bits of 'v'.
134static inline uint64_t TrailingBits(uint64_t v, int num_bits) {

Callers 2

VisitBitmapMethod · 0.85
TESTFunction · 0.85

Calls 2

RoundUpFunction · 0.85
RoundDownFunction · 0.85

Tested by 1

TESTFunction · 0.68