Same as Allocate() except the mem limit is checked before the allocation and this call will fail (returns NULL) if it does. The caller must handle the NULL case. This should be used for allocations where the size can be very big to bound the amount by which we exceed mem limits.
| 131 | /// The caller must handle the NULL case. This should be used for allocations |
| 132 | /// where the size can be very big to bound the amount by which we exceed mem limits. |
| 133 | uint8_t* TryAllocate(int64_t size) noexcept { |
| 134 | DFAKE_SCOPED_LOCK(mutex_); |
| 135 | return Allocate<true>(size, DEFAULT_ALIGNMENT); |
| 136 | } |
| 137 | |
| 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)]. |
no outgoing calls