| 181 | } |
| 182 | |
| 183 | Result<std::shared_ptr<Buffer>> AllocateBitmap(int64_t length, MemoryPool* pool) { |
| 184 | ARROW_ASSIGN_OR_RAISE(auto buf, AllocateBuffer(bit_util::BytesForBits(length), pool)); |
| 185 | // Zero out any trailing bits |
| 186 | if (buf->size() > 0) { |
| 187 | buf->mutable_data()[buf->size() - 1] = 0; |
| 188 | } |
| 189 | // R build with openSUSE155 requires an explicit shared_ptr construction |
| 190 | return std::shared_ptr<Buffer>(std::move(buf)); |
| 191 | } |
| 192 | |
| 193 | Result<std::shared_ptr<Buffer>> AllocateEmptyBitmap(int64_t length, MemoryPool* pool) { |
| 194 | return AllocateEmptyBitmap(length, kDefaultBufferAlignment, pool); |