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

Function SafeLoadWords

cpp/src/arrow/util/bitmap.h:427–447  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

425 /// load words from bitmaps bitwise
426 template <size_t N, typename Word>
427 static void SafeLoadWords(const Bitmap (&bitmaps)[N], int64_t offset,
428 int64_t out_length, bool set_trailing_bits,
429 std::array<Word, N>* out) {
430 out->fill(0);
431
432 int64_t out_offset = set_trailing_bits ? sizeof(Word) * 8 - out_length : 0;
433
434 Bitmap slices[N], out_bitmaps[N];
435 for (size_t i = 0; i < N; ++i) {
436 slices[i] = bitmaps[i].Slice(offset, out_length);
437 out_bitmaps[i] = Bitmap(&out->at(i), out_offset, out_length);
438 }
439
440 int64_t bit_i = 0;
441 Bitmap::VisitBits(slices, [&](std::bitset<N> bits) {
442 for (size_t i = 0; i < N; ++i) {
443 out_bitmaps[i].SetBitTo(bit_i, bits[i]);
444 }
445 ++bit_i;
446 });
447 }
448
449 /// assert bitmaps have identical length and return that length
450 static int64_t BitLength(const Bitmap* bitmaps, size_t N);

Callers 1

VisitWordsFunction · 0.85

Calls 4

fillMethod · 0.80
BitmapFunction · 0.70
VisitBitsFunction · 0.70
SliceMethod · 0.45

Tested by

no test coverage detected