Class PoolChunkList<T>

java.lang.Object
io.netty.buffer.PoolChunkList<T>
All Implemented Interfaces:
PoolChunkListMetric, java.lang.Iterable<PoolChunkMetric>

final class PoolChunkList<T> extends java.lang.Object implements PoolChunkListMetric
  • Field Details

    • EMPTY_METRICS

      private static final java.util.Iterator<PoolChunkMetric> EMPTY_METRICS
    • arena

      private final PoolArena<T> arena
    • nextList

      private final PoolChunkList<T> nextList
    • minUsage

      private final int minUsage
    • maxUsage

      private final int maxUsage
    • maxCapacity

      private final int maxCapacity
    • freeMinThreshold

      private final int freeMinThreshold
    • freeMaxThreshold

      private final int freeMaxThreshold
    • prevList

      private PoolChunkList<T> prevList
  • Constructor Details

    • PoolChunkList

      PoolChunkList(PoolArena<T> arena, PoolChunkList<T> nextList, int minUsage, int maxUsage, int chunkSize)
  • Method Details

    • calculateMaxCapacity

      private static int calculateMaxCapacity(int minUsage, int chunkSize)
      Calculates the maximum capacity of a buffer that will ever be possible to allocate out of the PoolChunks that belong to the PoolChunkList with the given minUsage and maxUsage settings.
    • prevList

      void prevList(PoolChunkList<T> prevList)
    • allocate

      boolean allocate(PooledByteBuf<T> buf, int reqCapacity, int sizeIdx, PoolThreadCache threadCache)
    • free

      boolean free(PoolChunk<T> chunk, long handle, int normCapacity, java.nio.ByteBuffer nioBuffer)
    • move

      private boolean move(PoolChunk<T> chunk)
    • move0

      private boolean move0(PoolChunk<T> chunk)
      Moves the PoolChunk down the PoolChunkList linked-list so it will end up in the right PoolChunkList that has the correct minUsage / maxUsage in respect to PoolChunk.usage().
    • add

      void add(PoolChunk<T> chunk)
    • add0

      void add0(PoolChunk<T> chunk)
      Adds the PoolChunk to this PoolChunkList.
    • remove

      private void remove(PoolChunk<T> cur)
    • minUsage

      public int minUsage()
      Description copied from interface: PoolChunkListMetric
      Return the minimum usage of the chunk list before which chunks are promoted to the previous list.
      Specified by:
      minUsage in interface PoolChunkListMetric
    • maxUsage

      public int maxUsage()
      Description copied from interface: PoolChunkListMetric
      Return the maximum usage of the chunk list after which chunks are promoted to the next list.
      Specified by:
      maxUsage in interface PoolChunkListMetric
    • minUsage0

      private static int minUsage0(int value)
    • iterator

      public java.util.Iterator<PoolChunkMetric> iterator()
      Specified by:
      iterator in interface java.lang.Iterable<T>
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object
    • destroy

      void destroy(PoolArena<T> arena)