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