| 149 | class Allocator { |
| 150 | public: |
| 151 | void* AllocateBytes(std::size_t num_bytes) { |
| 152 | if (num_bytes == 0) { |
| 153 | return nullptr; |
| 154 | } |
| 155 | return aligned.AllocateAlignedBytes( |
| 156 | round_up_pot(num_bytes, detail::AlignedAllocator::kAlignment)); |
| 157 | } |
| 158 | template <typename Pointer> |
| 159 | void Allocate(std::size_t count, Pointer* out) { |
| 160 | using T = typename std::pointer_traits<Pointer>::element_type; |