from the doc :
If avoidReallocating is true, then changing the buffer’s size won’t reduce the
amount of memory that is currently allocated (but it will still increase it if
the new size is bigger than the amount it currently has). If this is false, then
a new allocation will be done so that the buffer uses takes up the minimum amount of memory that it needs.
But this is only true if the other flag ‘
keepExistingContent’ is false.
keepExistingContent’ is true then ‘
avoidReallocating’ is ignored and the memory is always reallocated.
So if I do :
bool keepContent = true; bool clearExtra = false; bool avoidRealloc = true; buffer.setSize (buffer.getNumChannels(), buffer.getNumSamples() / 2, keepContent, clearExtra, avoidRealloc);
the buffer will be reallocated, while that’s not expected/necessary