Sets the freedom of the final chunk. Since no proper chunk follows the final chunk, the heap itself manages
        this. Nonetheless, for now it is implemented as if an additional chunk followed the final chunk.
518693
def _set_final_freeness(self, flag):
        
        if flag:
            self.state.memory.store(self.heap_base + self.heap_size - self._chunk_size_t_size, ~CHUNK_P_MASK)
        else:
            self.state.memory.store(self.heap_base + self.heap_size - self._chunk_size_t_size, CHUNK_P_MASK)
267017
public void setDiscarded()
    {
        state = state.transition(LifeCycle.DISCARDED);
        // release any memory owned by this allocator; automatically signals waiters
        onHeap.releaseAll();
        offHeap.releaseAll();
    }
671810
protected boolean finalizeAny() {
        GlobalSplitter<I, D> splitter = findSplitterGlobal();
        if (splitter != null) {
            finalizeDiscriminator(splitter.blockRoot, splitter.localSplitter);
            return true;
        }
        return false;
    }
109771
public void freeDependent()
    {
        if (m_recDependent != null) // If close and file is still open
            if (!m_recDependent.isInFree())
        {
            this.setDependentListener(null);    // In case you want to delete me!
            if (m_recDependent != null)
            {
                if (m_bCloseOnFree)
                    m_recDependent.close();    // File is still open, and my listener is still there, close it!
                else
                    m_recDependent.free();    // File is still open, and my listener is still there, close it!
            }
        }
        m_recDependent = null;
        if (m_freeable != null)
            m_freeable.free();
        m_freeable = null;
    }
1127601
public void freeCurrent() {
		int beforeReleaseNum = availableMemory.size();
		memManager.release(availableMemory);
		allocatedFloatingNum -= (beforeReleaseNum - availableMemory.size());
	}
271796
private void updateCurrentChunk(boolean lastChunk) throws IOException {
    // Early return for the most common case.
    if (mCurrentChunk != null && mCurrentChunk.writableBytes() > 0 && !lastChunk) {
      return;
    }

    if (mCurrentChunk == null) {
      if (!lastChunk) {
        mCurrentChunk = allocateBuffer();
      }
      return;
    }

    if (mCurrentChunk.writableBytes() == 0 || lastChunk) {
      try {
        if (mCurrentChunk.readableBytes() > 0) {
          for (DataWriter dataWriter : mDataWriters) {
            mCurrentChunk.retain();
            dataWriter.writeChunk(mCurrentChunk.duplicate());
          }
        } else {
          Preconditions.checkState(lastChunk);
        }
      } finally {
        // If the packet has bytes to read, we increment its refcount explicitly for every packet
        // writer. So we need to release here. If the packet has no bytes to read, then it has
        // to be the last packet. It needs to be released as well.
        mCurrentChunk.release();
        mCurrentChunk = null;
      }
    }
    if (!lastChunk) {
      mCurrentChunk = allocateBuffer();
    }
  }
347663
void free(boolean finalizer) {
        // As free() may be called either by the finalizer or by FastThreadLocal.onRemoval(...) we need to ensure
        // we only call this one time.
        if (freed.compareAndSet(false, true)) {
            int numFreed = free(tinySubPageDirectCaches, finalizer) +
                    free(smallSubPageDirectCaches, finalizer) +
                    free(normalDirectCaches, finalizer) +
                    free(tinySubPageHeapCaches, finalizer) +
                    free(smallSubPageHeapCaches, finalizer) +
                    free(normalHeapCaches, finalizer);

            if (numFreed > 0 && logger.isDebugEnabled()) {
                logger.debug("Freed {} thread-local buffer(s) from thread: {}", numFreed,
                        Thread.currentThread().getName());
            }

            if (directArena != null) {
                directArena.numThreadCaches.getAndDecrement();
            }

            if (heapArena != null) {
                heapArena.numThreadCaches.getAndDecrement();
            }
        }
    }
643908
synchronized void setLength(long length) {
        Preconditions.checkState(!this.sealed, "Cannot increase the length of a sealed SegmentChunk.");
        Preconditions.checkArgument(length >= 0, "length must be a non-negative number.");
        this.length = length;
    }
1264678
public void setInHeader(boolean inHeader) {
        super.setInHeader(inHeader);
        for(int i = 0; i < this.chunks.size(); i++) {
            ((RtfBasicElement) this.chunks.get(i)).setInHeader(inHeader);
        }
    }
83251
public final void setDataSegment (final IDataSegmentChunk chunk) {

        if (chunk == null) { throw new NullPointerException(); }

        dataSegment = ByteBuffer.allocate(chunk.getTotalLength());
        dataSegment.put(chunk.getData());
        basicHeaderSegment.setDataSegmentLength(chunk.getLength());
    }
1068062
def set_prev_freeness(self, is_free):
        
        level = silence_logger()
        size_field = self.state.memory.load(self.base + self._chunk_size_t_size, self._chunk_size_t_size)
        unsilence_logger(level)
        if is_free:
            self.state.memory.store(self.base + self._chunk_size_t_size, size_field & ~CHUNK_P_MASK)
        else:
            self.state.memory.store(self.base + self._chunk_size_t_size, size_field | CHUNK_P_MASK)
1141821
public void setCapacity(int capacity) {
        if (capacity <= 0) {
            throw new IllegalArgumentException("capacity must be greater than 0");
        }

        synchronized (queue) {
            // If the capacity was reduced, we remove oldest elements until the
            // queue fits inside the specified capacity
            if (capacity < this.capacity) {
                while (queue.size() > capacity) {
                    queue.removeFirst();
                }
            }
        }

        this.capacity = capacity;
    }
37628
def allocated_chunks(self):
        
        raise NotImplementedError("%s not implemented for %s" % (self.allocated_chunks.__func__.__name__,
                                                                 self.__class__.__name__))
510925
final protected synchronized void set(boolean verifyChecksum,
      Checksum sum, int maxChunkSize, int checksumSize ) {
    this.verifyChecksum = verifyChecksum;
    this.sum = sum;
    this.buf = new byte[maxChunkSize];
    this.checksum = new byte[checksumSize];
    this.count = 0;
    this.pos = 0;
  }
515184
private void checkInUseChunk(long p) {
    if (VALIDATING) {
      checkAnyChunk(p);
      if (!isInUse(p))
        throw new AssertionError("Chunk at " + p + " is not in use");
      if (!nextPreviousInUse(p))
        throw new AssertionError("Chunk after " + p + " does not see this chunk as in use");
      /* If not pinuse previous chunk has OK offset */
      if (!previousInUse(p) && nextChunk(prevChunk(p)) != p)
        throw new AssertionError("Previous chunk to " + p + " is marked free but has an incorrect next pointer");
    }
  }
333446
public void next() {
		newKeyGroup = false;
		newKVState = false;

		final RocksIteratorWrapper rocksIterator = currentSubIterator.getIterator();
		rocksIterator.next();

		byte[] oldKey = currentSubIterator.getCurrentKey();
		if (rocksIterator.isValid()) {

			currentSubIterator.setCurrentKey(rocksIterator.key());

			if (isDifferentKeyGroup(oldKey, currentSubIterator.getCurrentKey())) {
				heap.offer(currentSubIterator);
				currentSubIterator = heap.remove();
				newKVState = currentSubIterator.getIterator() != rocksIterator;
				detectNewKeyGroup(oldKey);
			}
		} else {
			IOUtils.closeQuietly(rocksIterator);

			if (heap.isEmpty()) {
				currentSubIterator = null;
				valid = false;
			} else {
				currentSubIterator = heap.remove();
				newKVState = true;
				detectNewKeyGroup(oldKey);
			}
		}
	}
481764
def set_contents(self, stream, chunk_size=None, size=None, size_limit=None,
                     progress_callback=None, **kwargs):
        
        self.set_uri(
            *self.storage(**kwargs).save(
                stream, chunk_size=chunk_size, size=size,
                size_limit=size_limit, progress_callback=progress_callback))