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 int
private final int
private final int
private final int
private final int
private 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) void
Adds thePoolChunk
to thisPoolChunkList
.(package private) boolean
allocate
(PooledByteBuf<T> buf, int reqCapacity, int sizeIdx, PoolThreadCache threadCache) private static int
calculateMaxCapacity
(int minUsage, int chunkSize) Calculates the maximum capacity of a buffer that will ever be possible to allocate out of thePoolChunk
s that belong to thePoolChunkList
with the givenminUsage
andmaxUsage
settings.(package private) void
(package private) boolean
free
(PoolChunk<T> chunk, long handle, int normCapacity, ByteBuffer nioBuffer) iterator()
int
maxUsage()
Return the maximum usage of the chunk list after which chunks are promoted to the next list.int
minUsage()
Return the minimum usage of the chunk list before which chunks are promoted to the previous list.private static int
minUsage0
(int value) private boolean
private boolean
Moves thePoolChunk
down thePoolChunkList
linked-list so it will end up in the rightPoolChunkList
that has the correct minUsage / maxUsage in respect toPoolChunk.usage()
.(package private) void
prevList
(PoolChunkList<T> prevList) private void
toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods 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 thePoolChunk
s that belong to thePoolChunkList
with the givenminUsage
andmaxUsage
settings. -
prevList
-
allocate
-
free
-
move
-
move0
Moves thePoolChunk
down thePoolChunkList
linked-list so it will end up in the rightPoolChunkList
that has the correct minUsage / maxUsage in respect toPoolChunk.usage()
. -
add
-
add0
Adds thePoolChunk
to thisPoolChunkList
. -
remove
-
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 interfacePoolChunkListMetric
-
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 interfacePoolChunkListMetric
-
minUsage0
private static int minUsage0(int value) -
iterator
-
toString
-
destroy
-