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

Function BytesForBits

cpp/src/arrow/util/bit_util.h:49–52  ·  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

47
48// Return the number of bytes needed to fit the given number of bits
49constexpr int64_t BytesForBits(int64_t bits) {
50 // This formula avoids integer overflow on very large `bits`
51 return (bits >> 3) + ((bits & 7) != 0);
52}
53
54// Returns the smallest power of two that contains v. If v is already a
55// 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
TestBitArrayValuesFunction · 0.68
TestPutValueFunction · 0.68
GetNumBytesFunction · 0.68
TESTFunction · 0.68
TEST_FFunction · 0.68
TESTFunction · 0.68