final class PoolChunkList<T> extends java.lang.Object implements PoolChunkListMetric
Modifier and Type | Field and Description |
---|---|
private static java.util.Iterator<PoolChunkMetric> |
EMPTY_METRICS |
private PoolChunk<T> |
head |
private int |
maxCapacity |
private int |
maxUsage |
private int |
minUsage |
private PoolChunkList<T> |
nextList |
private PoolChunkList<T> |
prevList |
Constructor and Description |
---|
PoolChunkList(PoolChunkList<T> nextList,
int minUsage,
int maxUsage,
int chunkSize) |
Modifier and Type | Method and Description |
---|---|
(package private) void |
add(PoolChunk<T> chunk) |
(package private) void |
add0(PoolChunk<T> chunk)
Adds the
PoolChunk to this PoolChunkList . |
(package private) boolean |
allocate(PooledByteBuf<T> buf,
int reqCapacity,
int normCapacity) |
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
PoolChunk s
that belong to the PoolChunkList with the given minUsage and maxUsage settings. |
(package private) void |
destroy(PoolArena<T> arena) |
(package private) boolean |
free(PoolChunk<T> chunk,
long handle) |
java.util.Iterator<PoolChunkMetric> |
iterator() |
int |
maxUsage()
Return the minum usage of the chunk list after which chunks are promoted to the next list.
|
int |
minUsage()
Return the minum usage of the chunk list before which chunks are promoted to the previous list.
|
private static int |
minUsage0(int value) |
private boolean |
move(PoolChunk<T> chunk) |
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() . |
(package private) void |
prevList(PoolChunkList<T> prevList) |
private void |
remove(PoolChunk<T> cur) |
java.lang.String |
toString() |
private static final java.util.Iterator<PoolChunkMetric> EMPTY_METRICS
private final PoolChunkList<T> nextList
private final int minUsage
private final int maxUsage
private final int maxCapacity
private PoolChunkList<T> prevList
PoolChunkList(PoolChunkList<T> nextList, int minUsage, int maxUsage, int chunkSize)
private static int calculateMaxCapacity(int minUsage, int chunkSize)
PoolChunk
s
that belong to the PoolChunkList
with the given minUsage
and maxUsage
settings.void prevList(PoolChunkList<T> prevList)
boolean allocate(PooledByteBuf<T> buf, int reqCapacity, int normCapacity)
private boolean move0(PoolChunk<T> chunk)
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()
.void add0(PoolChunk<T> chunk)
PoolChunk
to this PoolChunkList
.public int minUsage()
PoolChunkListMetric
minUsage
in interface PoolChunkListMetric
public int maxUsage()
PoolChunkListMetric
maxUsage
in interface PoolChunkListMetric
private static int minUsage0(int value)
public java.util.Iterator<PoolChunkMetric> iterator()
iterator
in interface java.lang.Iterable<PoolChunkMetric>
public java.lang.String toString()
toString
in class java.lang.Object