| 33 | namespace ree_util { |
| 34 | |
| 35 | Result<std::shared_ptr<Buffer>> AllocateValuesBuffer(int64_t length, const DataType& type, |
| 36 | MemoryPool* pool, |
| 37 | int64_t data_buffer_size) { |
| 38 | if (type.bit_width() == 1) { |
| 39 | // Make sure the bitmap is initialized (avoids Valgrind errors). |
| 40 | return AllocateEmptyBitmap(length, pool); |
| 41 | } else if (is_fixed_width(type.id())) { |
| 42 | return AllocateBuffer(length * type.byte_width(), pool); |
| 43 | } else { |
| 44 | DCHECK(is_base_binary_like(type.id())); |
| 45 | return AllocateBuffer(data_buffer_size, pool); |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | Result<std::shared_ptr<ArrayData>> PreallocateRunEndsArray( |
| 50 | const std::shared_ptr<DataType>& run_end_type, int64_t physical_length, |
nothing calls this directly
no test coverage detected