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

Function LoadPartialWord

cpp/src/arrow/util/bit_run_reader.h:305–322  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

303 }
304
305 uint64_t LoadPartialWord(int8_t bit_offset, int64_t num_bits) {
306 assert(num_bits > 0);
307 uint64_t word = 0;
308 const int64_t num_bytes = bit_util::BytesForBits(num_bits);
309 if (Reverse) {
310 // Read in the most significant bytes of the word
311 bitmap_ -= num_bytes;
312 memcpy(reinterpret_cast<char*>(&word) + 8 - num_bytes, bitmap_, num_bytes);
313 // XXX MostSignificantBitmask
314 return (bit_util::ToLittleEndian(word) << bit_offset) &
315 ~bit_util::LeastSignificantBitMask<uint64_t>(64 - num_bits);
316 } else {
317 memcpy(&word, bitmap_, num_bytes);
318 bitmap_ += num_bytes;
319 return (bit_util::ToLittleEndian(word) >> bit_offset) &
320 bit_util::LeastSignificantBitMask<uint64_t>(num_bits);
321 }
322 }
323
324 void SkipNextZeros() {
325 assert(current_num_bits_ == 0);

Callers 7

BitmapUInt64ReaderMethod · 0.85
NextWordMethod · 0.85
BaseSetBitRunReaderClass · 0.85
bit_run_reader.hFile · 0.85
NextRunFunction · 0.85
SkipNextZerosFunction · 0.85
CountNextOnesFunction · 0.85

Calls 2

BytesForBitsFunction · 0.85
ToLittleEndianFunction · 0.70

Tested by

no test coverage detected