| 48 | } |
| 49 | |
| 50 | int64_t TempVectorStack::PaddedAllocationSize(int64_t num_bytes) { |
| 51 | // Round up allocation size to multiple of 8 bytes |
| 52 | // to avoid returning temp vectors with unaligned address. |
| 53 | // |
| 54 | // Also add padding at the end to facilitate loads and stores |
| 55 | // using SIMD when number of vector elements is not divisible |
| 56 | // by the number of SIMD lanes. |
| 57 | // |
| 58 | return ::arrow::bit_util::RoundUp(num_bytes, sizeof(int64_t)) + kPadding; |
| 59 | } |
| 60 | |
| 61 | void TempVectorStack::alloc(uint32_t num_bytes, uint8_t** data, int* id) { |
| 62 | int64_t estimated_alloc_size = EstimatedAllocationSize(num_bytes); |