Same as TryAllocate() except a non-default alignment can be specified. It should be a power-of-two in [1, alignof(std::max_align_t)].
| 138 | /// Same as TryAllocate() except a non-default alignment can be specified. It |
| 139 | /// should be a power-of-two in [1, alignof(std::max_align_t)]. |
| 140 | uint8_t* TryAllocateAligned(int64_t size, int alignment) noexcept { |
| 141 | DFAKE_SCOPED_LOCK(mutex_); |
| 142 | DCHECK_GE(alignment, 1); |
| 143 | DCHECK_LE(alignment, alignof(std::max_align_t)); |
| 144 | DCHECK_EQ(BitUtil::RoundUpToPowerOfTwo(alignment), alignment); |
| 145 | return Allocate<true>(size, alignment); |
| 146 | } |
| 147 | |
| 148 | /// Same as TryAllocate() except returned memory is not aligned at all. |
| 149 | uint8_t* TryAllocateUnaligned(int64_t size) noexcept { |
no outgoing calls