36template <
class ElementType,
class TypeOfCriticalSectionToUse>
48 : elements (std::move (other.elements)),
49 numAllocated (other.numAllocated)
55 elements = std::move (other.elements);
56 numAllocated = other.numAllocated;
70 if (numAllocated != numElements)
73 elements.realloc ((
size_t) numElements);
77 numAllocated = numElements;
91 if (minNumElements > numAllocated)
94 jassert (numAllocated <= 0 || elements !=
nullptr);
102 if (maxNumElements < numAllocated)
109 elements.swapWith (other.elements);
110 std::swap (numAllocated, other.numAllocated);
115 int numAllocated = 0;
void shrinkToNoMoreThan(int maxNumElements)
ArrayAllocationBase()=default
~ArrayAllocationBase()=default
void ensureAllocatedSize(int minNumElements)
void setAllocatedSize(int numElements)
void swapWith(ArrayAllocationBase &other) noexcept