| 171 | } |
| 172 | |
| 173 | Result<std::shared_ptr<Buffer>> AllocateBitmap(int64_t length, MemoryPool* pool) { |
| 174 | ARROW_ASSIGN_OR_RAISE(auto buf, AllocateBuffer(bit_util::BytesForBits(length), pool)); |
| 175 | // Zero out any trailing bits |
| 176 | if (buf->size() > 0) { |
| 177 | buf->mutable_data()[buf->size() - 1] = 0; |
| 178 | } |
| 179 | return buf; |
| 180 | } |
| 181 | |
| 182 | Result<std::shared_ptr<Buffer>> AllocateEmptyBitmap(int64_t length, MemoryPool* pool) { |
| 183 | return AllocateEmptyBitmap(length, kDefaultBufferAlignment, pool); |