Package io.netty.buffer
Class PoolChunkList<T>
java.lang.Object
io.netty.buffer.PoolChunkList<T>
- All Implemented Interfaces:
PoolChunkListMetric,Iterable<PoolChunkMetric>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Iterator<PoolChunkMetric> private final intprivate final intprivate final intprivate final intprivate final intprivate final PoolChunkList<T> private PoolChunkList<T> -
Constructor Summary
ConstructorsConstructorDescriptionPoolChunkList(PoolArena<T> arena, PoolChunkList<T> nextList, int minUsage, int maxUsage, int chunkSize) -
Method Summary
Modifier and TypeMethodDescription(package private) void(package private) voidAdds thePoolChunkto thisPoolChunkList.(package private) booleanallocate(PooledByteBuf<T> buf, int reqCapacity, int sizeIdx, PoolThreadCache threadCache) private static intcalculateMaxCapacity(int minUsage, int chunkSize) Calculates the maximum capacity of a buffer that will ever be possible to allocate out of thePoolChunks that belong to thePoolChunkListwith the givenminUsageandmaxUsagesettings.(package private) void(package private) booleanfree(PoolChunk<T> chunk, long handle, int normCapacity, ByteBuffer nioBuffer) iterator()intmaxUsage()Return the maximum usage of the chunk list after which chunks are promoted to the next list.intminUsage()Return the minimum usage of the chunk list before which chunks are promoted to the previous list.private static intminUsage0(int value) private booleanprivate booleanMoves thePoolChunkdown thePoolChunkListlinked-list so it will end up in the rightPoolChunkListthat has the correct minUsage / maxUsage in respect toPoolChunk.usage().(package private) voidprevList(PoolChunkList<T> prevList) private voidtoString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
EMPTY_METRICS
-
arena
-
nextList
-
minUsage
private final int minUsage -
maxUsage
private final int maxUsage -
maxCapacity
private final int maxCapacity -
head
-
freeMinThreshold
private final int freeMinThreshold -
freeMaxThreshold
private final int freeMaxThreshold -
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 thePoolChunks that belong to thePoolChunkListwith the givenminUsageandmaxUsagesettings. -
prevList
-
allocate
-
free
-
move
-
move0
Moves thePoolChunkdown thePoolChunkListlinked-list so it will end up in the rightPoolChunkListthat has the correct minUsage / maxUsage in respect toPoolChunk.usage(). -
add
-
add0
Adds thePoolChunkto thisPoolChunkList. -
remove
-
minUsage
public int minUsage()Description copied from interface:PoolChunkListMetricReturn the minimum usage of the chunk list before which chunks are promoted to the previous list.- Specified by:
minUsagein interfacePoolChunkListMetric
-
maxUsage
public int maxUsage()Description copied from interface:PoolChunkListMetricReturn the maximum usage of the chunk list after which chunks are promoted to the next list.- Specified by:
maxUsagein interfacePoolChunkListMetric
-
minUsage0
private static int minUsage0(int value) -
iterator
-
toString
-
destroy
-