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 AdaptivePoolingAllocator.ChunkRegistryprivate final intprivate final int -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateSizeClassChunkController(AdaptivePoolingAllocator.MagazineGroup group, int segmentSize, int chunkSize) -
Method Summary
Modifier and TypeMethodDescriptionintcomputeBufferCapacity(int requestedSize, int maxCapacity, boolean isReallocation) Compute the "fast max capacity" value for the buffer.private MpscIntQueueprivate MpscIntQueuenewChunkAllocation(int promptingSize, AdaptivePoolingAllocator.Magazine magazine) Allocate a newAdaptivePoolingAllocator.Chunkfor the givenAdaptivePoolingAllocator.Magazine.
-
Field Details
-
chunkAllocator
-
segmentSize
private final int segmentSize -
chunkSize
private final int chunkSize -
chunkRegistry
-
-
Constructor Details
-
SizeClassChunkController
private SizeClassChunkController(AdaptivePoolingAllocator.MagazineGroup group, int segmentSize, int chunkSize)
-
-
Method Details
-
createEmptyFreeList
-
createFreeList
-
createLocalFreeList
-
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
-