diff --git a/modules/juce_core/containers/juce_Array.h b/modules/juce_core/containers/juce_Array.h index 2f089d86ab..630ada5eac 100644 --- a/modules/juce_core/containers/juce_Array.h +++ b/modules/juce_core/containers/juce_Array.h @@ -56,7 +56,8 @@ @see OwnedArray, ReferenceCountedArray, StringArray, CriticalSection */ template + typename TypeOfCriticalSectionToUse = DummyCriticalSection, + int minimumAllocatedSize = 0> class Array { private: @@ -1035,8 +1036,8 @@ private: void minimiseStorageAfterRemoval() { - if (data.numAllocated > numUsed * 2) - data.shrinkToNoMoreThan (jmax (numUsed, 64 / (int) sizeof (ElementType))); + if (data.numAllocated > jmax (minimumAllocatedSize, numUsed * 2)) + data.shrinkToNoMoreThan (jmax (numUsed, jmax (minimumAllocatedSize, 64 / (int) sizeof (ElementType)))); } };