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

Function BytesForBits

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

Return the number of bytes needed to fit the given number of bits

Source from the content-addressed store, hash-verified

50
51// Return the number of bytes needed to fit the given number of bits
52constexpr int64_t BytesForBits(int64_t bits) {
53 // This formula avoids integer overflow on very large `bits`
54 return (bits >> 3) + ((bits & 7) != 0);
55}
56
57// Returns the smallest power of two that contains v. If v is already a
58// power of two, it is returned as is.

Callers 15

AllocateNullBitmapFunction · 0.85
PrepareInputDataMethod · 0.85
VisitMethod · 0.85
bytes_requiredMethod · 0.85
ResizeMethod · 0.85
FinishMethod · 0.85
FinishWithLengthMethod · 0.85
TESTFunction · 0.85
NullInfoFromBatchMethod · 0.85
InitHasMatchIfNeededMethod · 0.85
MergeHasMatchMethod · 0.85
FilterSingleBatchMethod · 0.85

Calls

no outgoing calls

Tested by 15

TESTFunction · 0.68
TakeUsingVectorFunction · 0.68
TestBloomLargeFunction · 0.68
TEST_FFunction · 0.68
CheckDecoderClobberFunction · 0.68
CheckBitmapDecoderFunction · 0.68
TEST_PFunction · 0.68
CheckRleBitPackedDecodeFunction · 0.68
TESTFunction · 0.68
TestBitArrayValuesFunction · 0.68
TestPutValueFunction · 0.68