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

Function LoadPartialWord

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

Source from the content-addressed store, hash-verified

309 }
310
311 uint64_t LoadPartialWord(int8_t bit_offset, int64_t num_bits) {
312 assert(num_bits > 0);
313 uint64_t word = 0;
314 const int64_t num_bytes = bit_util::BytesForBits(num_bits);
315 if (Reverse) {
316 // Read in the most significant bytes of the word
317 bitmap_ -= num_bytes;
318 memcpy(reinterpret_cast<char*>(&word) + 8 - num_bytes, bitmap_, num_bytes);
319 // XXX MostSignificantBitmask
320 return (bit_util::ToLittleEndian(word) << bit_offset) &
321 ~bit_util::LeastSignificantBitMask<uint64_t>(64 - num_bits);
322 } else {
323 memcpy(&word, bitmap_, num_bytes);
324 bitmap_ += num_bytes;
325 return (bit_util::ToLittleEndian(word) >> bit_offset) &
326 bit_util::LeastSignificantBitMask<uint64_t>(num_bits);
327 }
328 }
329
330 void SkipNextZeros() {
331 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