43 template <
class U>
struct rebind final {
47 [[nodiscard]]
T*
allocate(std::size_t numElts)
const {
48 static_assert(size_t(alignment) >=
alignof(
T),
"insufficient alignment");
49 invariant(numElts > 0 &&
"Should not be trying to allocate no elements");
50 assert(numElts <= allocator_traits::max_size(*
this) &&
51 "Can allocate this many elements.");
53 "Byte count calculation will not overflow");
55 std::size_t numBytes =
sizeof(
T) * numElts;
57#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
62 if (numBytes > 2UL << 30UL)
63 ThrowRSE(
"FUZZ alloc bailout (%zu bytes)", numBytes);
66 auto* r =
static_cast<T*
>(
operator new(
67 numBytes,
static_cast<std::align_val_t
>(alignment)));
70 ThrowRSE(
"Out of memory while trying to allocate %zu bytes", numBytes);
78 operator delete(p,
static_cast<std::align_val_t
>(alignment));
86template <
class T1,
int A1,
class T2,
int A2>
92template <
class T1,
int A1,
class T2,
int A2>
assert(dim.area() >=area)
std::allocator_traits< self > allocator_traits
void deallocate(T *p, std::size_t n) const noexcept
std::true_type propagate_on_container_copy_assignment
std::true_type propagate_on_container_move_assignment
std::true_type propagate_on_container_swap
AlignedAllocator< T, alignment > self
T * allocate(std::size_t numElts) const
bool operator!=(const AlignedAllocator< T1, A1 > &, const AlignedAllocator< T2, A2 > &)
constexpr RAWSPEED_READNONE bool isAligned(T value, size_t multiple)
bool operator==(const AlignedAllocator< T1, A1 > &, const AlignedAllocator< T2, A2 > &)
AlignedAllocator< U, alignment > other