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

Function BytesToBits

cpp/src/arrow/util/bitmap_builders.cc:47–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45} // namespace
46
47Result<std::shared_ptr<Buffer>> BytesToBits(std::span<const uint8_t> bytes,
48 MemoryPool* pool) {
49 int64_t bit_length = bit_util::BytesForBits(bytes.size());
50
51 ARROW_ASSIGN_OR_RAISE(auto buffer, AllocateBuffer(bit_length, pool));
52 uint8_t* out_buf = buffer->mutable_data();
53 memset(out_buf, 0, static_cast<size_t>(buffer->capacity()));
54 FillBitsFromBytes(bytes, out_buf);
55 // R build with openSUSE155 requires an explicit shared_ptr construction
56 return std::shared_ptr<Buffer>(std::move(buffer));
57}
58
59Result<std::shared_ptr<Buffer>> BitmapAllButOne(MemoryPool* pool, int64_t length,
60 int64_t straggler_pos, bool value) {

Callers 8

MakeArrayMethod · 0.85
CheckMethod · 0.85
array_test.ccFile · 0.85
TestCreateMethod · 0.85
SetUpMethod · 0.85
TYPED_TESTFunction · 0.85
TESTFunction · 0.85
ASSERT_OK_AND_ASSIGNFunction · 0.85

Calls 5

BytesForBitsFunction · 0.85
FillBitsFromBytesFunction · 0.85
sizeMethod · 0.45
mutable_dataMethod · 0.45
capacityMethod · 0.45

Tested by 7

MakeArrayMethod · 0.68
CheckMethod · 0.68
TestCreateMethod · 0.68
SetUpMethod · 0.68
TYPED_TESTFunction · 0.68
TESTFunction · 0.68
ASSERT_OK_AND_ASSIGNFunction · 0.68