Package io.netty.buffer
Class AdaptivePoolingAllocator.SizeClassChunkController
java.lang.Object
io.netty.buffer.AdaptivePoolingAllocator.SizeClassChunkController
- All Implemented Interfaces:
AdaptivePoolingAllocator.ChunkController
- Enclosing class:
AdaptivePoolingAllocator
private static final class AdaptivePoolingAllocator.SizeClassChunkController
extends Object
implements AdaptivePoolingAllocator.ChunkController
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AdaptivePoolingAllocator.ChunkAllocatorprivate final Set<AdaptivePoolingAllocator.Chunk> private final intprivate static final intprivate final int -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateSizeClassChunkController(AdaptivePoolingAllocator.MagazineGroup group, int segmentSize) -
Method Summary
Modifier and TypeMethodDescriptionintcomputeBufferCapacity(int requestedSize, int maxCapacity, boolean isReallocation) Compute the "fast max capacity" value for the buffer.voidinitializeSharedStateIn(AdaptivePoolingAllocator.ChunkController chunkController) Initialize the given chunk factory with shared statistics state (if any) from this factory.newChunkAllocation(int promptingSize, AdaptivePoolingAllocator.Magazine magazine) Allocate a newAdaptivePoolingAllocator.Chunkfor the givenAdaptivePoolingAllocator.Magazine.
-
Field Details
-
MIN_SEGMENTS_PER_CHUNK
private static final int MIN_SEGMENTS_PER_CHUNK- See Also:
-
chunkAllocator
-
segmentSize
private final int segmentSize -
chunkSize
private final int chunkSize -
chunkRegistry
-
-
Constructor Details
-
SizeClassChunkController
-
-
Method Details
-
computeBufferCapacity
public int computeBufferCapacity(int requestedSize, int maxCapacity, boolean isReallocation) Description copied from interface:AdaptivePoolingAllocator.ChunkControllerCompute the "fast max capacity" value for the buffer.- Specified by:
computeBufferCapacityin interfaceAdaptivePoolingAllocator.ChunkController
-
newChunkAllocation
public AdaptivePoolingAllocator.Chunk newChunkAllocation(int promptingSize, AdaptivePoolingAllocator.Magazine magazine) Description copied from interface:AdaptivePoolingAllocator.ChunkControllerAllocate a newAdaptivePoolingAllocator.Chunkfor the givenAdaptivePoolingAllocator.Magazine.- Specified by:
newChunkAllocationin interfaceAdaptivePoolingAllocator.ChunkController
-