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:
parent
5463294ec4
commit
f2a23e3459
|
@ -440,12 +440,11 @@ public class BigArrays implements Releasable {
|
|||
|
||||
private <T extends AbstractBigArray> T resizeInPlace(T array, long newSize) {
|
||||
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=" +
|
||||
oldMemSize + ", ramBytesEstimated=" + array.ramBytesEstimated(array.size);
|
||||
oldMemSize + ", ramBytesEstimated=" + array.ramBytesEstimated(oldSize);
|
||||
final long estimatedIncreaseInBytes = array.ramBytesEstimated(newSize) - oldMemSize;
|
||||
assert estimatedIncreaseInBytes >= 0 :
|
||||
"estimated increase in bytes for resizing should not be negative: " + estimatedIncreaseInBytes;
|
||||
adjustBreaker(estimatedIncreaseInBytes, false);
|
||||
array.resize(newSize);
|
||||
return array;
|
||||
|
|
Loading…
Reference in New Issue