final int curCombBufItemCap = getCombinedBufferItemCapacity(); //K, prev N, Direct case
final int curUsedCap = DoublesUpdateImpl.getRequiredItemCapacity(k_, getN());
final int itemSpaceNeeded = DoublesUpdateImpl.getRequiredItemCapacity(k_, newN);
if (itemSpaceNeeded > curCombBufItemCap) {
mem_ = growCombinedMemBuffer(mem_, itemSpaceNeeded);
<BUG>memObj_ = mem_.array(); //may be null
memAdd_ = mem_.getCumulativeOffset(0L);</BUG>
}
if (itemSpaceNeeded > curUsedCap) { //clear out the next level
mem_.clear(curUsedCap << 3, (itemSpaceNeeded - curUsedCap) << 3);

final int curCombBufItemCap = getCombinedBufferItemCapacity(); //K, prev N, Direct case
final int curUsedCap = DoublesUpdateImpl.getRequiredItemCapacity(k_, getN());
final int itemSpaceNeeded = DoublesUpdateImpl.getRequiredItemCapacity(k_, newN);
if (itemSpaceNeeded > curCombBufItemCap) {
mem_ = growCombinedMemBuffer(mem_, itemSpaceNeeded);
}
if (itemSpaceNeeded > curUsedCap) { //clear out the next level
mem_.clear(curUsedCap << 3, (itemSpaceNeeded - curUsedCap) << 3);
