| 45 | } // namespace |
| 46 | |
| 47 | Result<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 | |
| 59 | Result<std::shared_ptr<Buffer>> BitmapAllButOne(MemoryPool* pool, int64_t length, |
| 60 | int64_t straggler_pos, bool value) { |