Recycles all ByteBufs of this queue and sets
{@code first} and {@code last} indexes to 0.
546042
@Override
	public void recycle() {
		for (int i = first; i != last; i = next(i)) {
			bufs[i].recycle();
		}
		first = last = 0;
	}
1280590
public synchronized void setOpenedIndexes(List<ZipFileIndex>indexes) throws IllegalStateException {
        if (map.isEmpty()) {
            String msg =
                    "Setting opened indexes should be called only when the ZipFileCache is empty. "
                    + "Call JavacFileManager.flush() before calling this method.";
            throw new IllegalStateException(msg);
        }

        for (ZipFileIndex zfi : indexes) {
            map.put(zfi.zipFile, zfi);
        }
    }
448374
public synchronized void reset() {
		timeoutAt = 0;
		prevSeq = -1;
		pool.clear();
		stream.closed.set(false);
		stream.buffer.clear();
		stream.cause = null;
		stream.transferedBytes.set(0);
		inited.set(false);
	}
816398
private void cleanupDecBuffers() {
        // if we have decrypted buffers and they are either JIT created or made
        // during decryption/expansion (user buffers too small) then release them
        // here and dereference
        if (null != this.decryptedNetBuffers
            && (callerRequiredAllocation || decryptedNetBufferReleaseRequired)) {
            WsByteBufferUtils.releaseBufferArray(this.decryptedNetBuffers);
            this.decryptedNetBuffers = null;
        }
    }
1306738
@Override
	public void reset() {
		// reset all offsets
		this.numRecords = 0;
		this.currentSortBufferOffset = 0;
		this.sortBufferBytes = 0;
		
		// return all memory
		this.freeMemory.addAll(this.sortBuffer);
		this.sortBuffer.clear();
		
		// grab first buffers
		this.currentSortBufferSegment = nextMemorySegment();
		this.sortBuffer.add(this.currentSortBufferSegment);
		this.outView.set(this.currentSortBufferSegment);
	}
918056
public CompositeByteBuf discardReadComponents() {
        ensureAccessible();
        final int readerIndex = readerIndex();
        if (readerIndex == 0) {
            return this;
        }

        // Discard everything if (readerIndex = writerIndex = capacity).
        int writerIndex = writerIndex();
        if (readerIndex == writerIndex && writerIndex == capacity()) {
            for (int i = 0, size = componentCount; i < size; i++) {
                components[i].free();
            }
            lastAccessed = null;
            clearComps();
            setIndex(0, 0);
            adjustMarkers(readerIndex);
            return this;
        }

        // Remove read components.
        int firstComponentId = 0;
        Component c = null;
        for (int size = componentCount; firstComponentId < size; firstComponentId++) {
            c = components[firstComponentId];
            if (c.endOffset > readerIndex) {
                break;
            }
            c.free();
        }
        if (firstComponentId == 0) {
            return this; // Nothing to discard
        }
        Component la = lastAccessed;
        if (la != null && la.endOffset <= readerIndex) {
            lastAccessed = null;
        }
        removeCompRange(0, firstComponentId);

        // Update indexes and markers.
        int offset = c.offset;
        updateComponentOffsets(0);
        setIndex(readerIndex - offset, writerIndex - offset);
        adjustMarkers(offset);
        return this;
    }
815726
@Override
  protected void clearCache() {
    if (lastX != null) lastX[0] = Double.NaN;
    if (lastXBatch != null) lastXBatch[0] = Double.NaN;
    if (lastVBatch != null) lastVBatch[0] = Double.NaN;
  }
395591
private void discardReadBytesIfNecessary(ByteBuf buffer) {

        float usedRatio = (float) buffer.readerIndex() / buffer.capacity();

        if (usedRatio >= discardReadBytesRatio && buffer.refCnt() != 0) {
            buffer.discardReadBytes();
        }
    }
425015
public void endDataSwapPhase(){

        if (nextMap == null) {
            throw new IllegalStateException("Cannot call PhasedHeapFriendlyHashMap.endDataSwapPhase(), not currently in data swap phase");
        }

        HeapFriendlyHashMap<K, V> temp = currentMap;

        currentMap = nextMap;
        nextMap = null;

        temp.releaseObjectArrays();

        recycler.clearNextCycleObjectArrays();
    }
1262589
public void clear () {
		for (int i = 0; i < size; i++)
			queue[i] = null;
		size = 0;
		set.clear();
	}
965255
public final void reset(boolean resetChunkSize) {
        markBufferChanged();
        firstChunk = null;
        lastChunk = null;
        totalCharsInList = 0;
        totalCharsInDynamicChunks = -1;
        sizeAtLeast = -1;
        if (resetChunkSize) {
            chunkSize = firstChunkSize;
            totalChunkSize = 0;
        }
        if (allocBuffer == null) {
            allocBuffer = new AllocatedBuffer(chunkSize);
        } else {
            allocBuffer.clear();
        }
        if (dynamicChunkMap == null) {
            dynamicChunkMap = new HashMap<StreamCharBufferKey, StreamCharBufferSubChunk>();
        } else {
            dynamicChunkMap.clear();
        }
    }
1090550
public void reset() {

		// reset all offsets
		this.numRecords = 0;
		this.currentSortIndexOffset = 0;
		this.currentDataBufferOffset = 0;
		this.sortIndexBytes = 0;

		// return all memory
		returnToSegmentPool();

		// grab first buffers
		this.currentSortIndexSegment = nextMemorySegment();
		this.sortIndex.add(this.currentSortIndexSegment);
		this.recordCollector.reset();
	}
1026466
public void destroyAllBufferPools() {
		synchronized (factoryLock) {
			// create a copy to avoid concurrent modification exceptions
			LocalBufferPool[] poolsCopy = allBufferPools.toArray(new LocalBufferPool[allBufferPools.size()]);

			for (LocalBufferPool pool : poolsCopy) {
				pool.lazyDestroy();
			}

			// some sanity checks
			if (allBufferPools.size() > 0 || numTotalRequiredBuffers > 0) {
				throw new IllegalStateException("NetworkBufferPool is not empty after destroying all LocalBufferPools");
			}
		}
	}
880574
private boolean setPrevious(byte[] sequence, int start, int length) {
    if (previous == null || previous.length < length) {
      previous = new byte[length];
    }

    System.arraycopy(sequence, start, previous, 0, length);
    previousLength = length;
    return true;
  }
140016
def discard_last(self, indices):
        """"""
        for i in indices:
            self.buffer_expire[i] = self.buffer_expire[i][:-1]
            self.buffer[i] = self.buffer[i][:-1]
743968
@Override
  public synchronized void reset() {
    finish = false;
    finished = false;
    uncompressedDirectBuf.clear();
    uncompressedDirectBufLen = 0;
    compressedDirectBuf.clear();
    compressedDirectBuf.limit(0);
    userBufOff = userBufLen = 0;
    bytesRead = bytesWritten = 0L;
  }
1330573
public void reset()
    {
        this.bufferSize = 0;
        this.bufferPos = 0;
        this.bufferSizeAfterLimit = 0;
        this.currentLimit = Integer.MAX_VALUE;
        this.lastTag = 0;
        this.packedLimit = 0;
        this.sizeLimit = DEFAULT_SIZE_LIMIT;
        resetSizeCounter();
    }