| 218 | class DebugAllocator { |
| 219 | public: |
| 220 | static Status AllocateAligned(int64_t size, int64_t alignment, uint8_t** out) { |
| 221 | if (size == 0) { |
| 222 | *out = memory_pool::internal::kZeroSizeArea; |
| 223 | } else { |
| 224 | ARROW_ASSIGN_OR_RAISE(int64_t raw_size, RawSize(size)); |
| 225 | DCHECK(raw_size > size) << "bug in raw size computation: " << raw_size |
| 226 | << " for size " << size; |
| 227 | RETURN_NOT_OK(WrappedAllocator::AllocateAligned(raw_size, alignment, out)); |
| 228 | InitAllocatedArea(*out, size); |
| 229 | } |
| 230 | return Status::OK(); |
| 231 | } |
| 232 | |
| 233 | static void ReleaseUnused() { WrappedAllocator::ReleaseUnused(); } |
| 234 | |