public void recycleByteBlocks(byte[][] blocks, int start, int end) {final int numBlocks = Math.min(maxBufferedBlocks - freeBlocks, end - start);final int size = freeBlocks + numBlocks;if (size >= freeByteBlocks.length) {final byte[][] newBlocks = new byte[ArrayUtil.oversize(size,RamUsageEstimator.NUM_BYTES_OBJECT_REF)][];System.arraycopy(freeByteBlocks, 0, newBlocks, 0, freeBlocks);freeByteBlocks = newBlocks;}final int stop = start + numBlocks;for (int i = start; i < stop; i++) {freeByteBlocks[freeBlocks++] = blocks[i];blocks[i] = null;}for (int i = stop; i < end; i++) {blocks[i] = null;}bytesUsed.addAndGet(-(end - stop) * blockSize);assert bytesUsed.get() >= 0;}
public override void RecycleByteBlocks(byte[][] blocks, int start, int end){int numBlocks = Math.Min(maxBufferedBlocks - freeBlocks, end - start);int size = freeBlocks + numBlocks;if (size >= freeByteBlocks.Length){var newBlocks = new byte[ArrayUtil.Oversize(size, RamUsageEstimator.NUM_BYTES_OBJECT_REF)][];Array.Copy(freeByteBlocks, 0, newBlocks, 0, freeBlocks);freeByteBlocks = newBlocks;}int stop = start + numBlocks;for (int i = start; i < stop; i++){freeByteBlocks[freeBlocks++] = blocks[i];blocks[i] = null;}for (int i = stop; i < end; i++){blocks[i] = null;}bytesUsed.AddAndGet(-(end - stop) * m_blockSize);Debug.Assert(bytesUsed.Get() >= 0);}