Removes an invalid assert in resizing big arrays which does not always

hold (resizing can result in a smaller size than the current size, while
the assert attempted to verify the new size is always greater than the
current).
This commit is contained in:
Ali Beyad 2017-06-05 11:49:06 -04:00
parent 5463294ec4
commit f2a23e3459
1 changed files with 3 additions and 4 deletions

View File

@ -440,12 +440,11 @@ public class BigArrays implements Releasable {
private <T extends AbstractBigArray> T resizeInPlace(T array, long newSize) { private <T extends AbstractBigArray> T resizeInPlace(T array, long newSize) {
final long oldMemSize = array.ramBytesUsed(); final long oldMemSize = array.ramBytesUsed();
assert oldMemSize == array.ramBytesEstimated(array.size) : final long oldSize = array.size();
assert oldMemSize == array.ramBytesEstimated(oldSize) :
"ram bytes used should equal that which was previously estimated: ramBytesUsed=" + "ram bytes used should equal that which was previously estimated: ramBytesUsed=" +
oldMemSize + ", ramBytesEstimated=" + array.ramBytesEstimated(array.size); oldMemSize + ", ramBytesEstimated=" + array.ramBytesEstimated(oldSize);
final long estimatedIncreaseInBytes = array.ramBytesEstimated(newSize) - oldMemSize; final long estimatedIncreaseInBytes = array.ramBytesEstimated(newSize) - oldMemSize;
assert estimatedIncreaseInBytes >= 0 :
"estimated increase in bytes for resizing should not be negative: " + estimatedIncreaseInBytes;
adjustBreaker(estimatedIncreaseInBytes, false); adjustBreaker(estimatedIncreaseInBytes, false);
array.resize(newSize); array.resize(newSize);
return array; return array;