26#ifndef WATER_ARRAYALLOCATIONBASE_H_INCLUDED
27#define WATER_ARRAYALLOCATIONBASE_H_INCLUDED
31#include "CarlaUtils.hpp"
44template <
class ElementType>
73 if (numNewElements > 0)
75 if (!
elements.realloc ((
size_t) numNewElements))
100 return setAllocatedSize ((minNumElements + minNumElements / 2U + 8U) & ~7U);
123 void moveMemory (ElementType* target,
const ElementType* source,
const size_t numElements)
noexcept
130 std::memmove (target, source, ((
size_t) numElements) *
sizeof (ElementType));
#define CARLA_SAFE_ASSERT_RETURN(cond, ret)
Definition CarlaDefines.h:190
#define CARLA_DECLARE_NON_COPYABLE(ClassName)
Definition CarlaDefines.h:242
#define noexcept
Definition DistrhoDefines.h:72
void swapWith(ArrayAllocationBase< ElementType > &other) noexcept
Definition ArrayAllocationBase.h:117
size_t numAllocated
Definition ArrayAllocationBase.h:135
~ArrayAllocationBase() noexcept
Definition ArrayAllocationBase.h:57
bool setAllocatedSize(const size_t numNewElements) noexcept
Definition ArrayAllocationBase.h:69
HeapBlock< ElementType > elements
Definition ArrayAllocationBase.h:134
ArrayAllocationBase() noexcept
Definition ArrayAllocationBase.h:50
bool ensureAllocatedSize(const size_t minNumElements) noexcept
Definition ArrayAllocationBase.h:97
bool shrinkToNoMoreThan(const size_t maxNumElements) noexcept
Definition ArrayAllocationBase.h:108
void moveMemory(ElementType *target, const ElementType *source, const size_t numElements) noexcept
Definition ArrayAllocationBase.h:123
Definition HeapBlock.h:77
Definition AudioSampleBuffer.h:33