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

Method PutNextTrailingByte

cpp/src/arrow/util/bitmap_writer.h:229–255  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

227 }
228
229 void PutNextTrailingByte(uint8_t byte, int valid_bits) {
230 if (valid_bits == 8) {
231 if (may_have_byte_offset && offset_) {
232 byte = (byte << offset_) | (byte >> (8 - offset_));
233 uint8_t next_byte = load<uint8_t>(bitmap_ + 1);
234 current_data.epi.byte_ = (current_data.epi.byte_ & mask_) | (byte & ~mask_);
235 next_byte = (next_byte & ~mask_) | (byte & mask_);
236 store<uint8_t>(bitmap_, current_data.epi.byte_);
237 store<uint8_t>(bitmap_ + 1, next_byte);
238 current_data.epi.byte_ = next_byte;
239 } else {
240 store<uint8_t>(bitmap_, byte);
241 }
242 ++bitmap_;
243 } else {
244 assert(valid_bits > 0);
245 assert(valid_bits < 8);
246 assert(bitmap_ + bit_util::BytesForBits(offset_ + valid_bits) <= bitmap_end_);
247 internal::BitmapWriter writer(bitmap_, offset_, valid_bits);
248 for (int i = 0; i < valid_bits; ++i) {
249 (byte & 0x01) ? writer.Set() : writer.Clear();
250 writer.Next();
251 byte >>= 1;
252 }
253 writer.Finish();
254 }
255 }
256
257 private:
258 int64_t offset_;

Callers 3

TransferBitmapFunction · 0.80
UnalignedBitmapOpFunction · 0.80

Calls 5

BytesForBitsFunction · 0.85
SetMethod · 0.45
ClearMethod · 0.45
NextMethod · 0.45
FinishMethod · 0.45

Tested by

no test coverage detected