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 java.lang.Object implements AdaptivePoolingAllocator.ChunkController
-
-
Field Summary
Fields Modifier and Type Field Description private AdaptivePoolingAllocator.ChunkAllocatorchunkAllocatorprivate AdaptivePoolingAllocator.ChunkRegistrychunkRegistryprivate intchunkSizeprivate static AdaptivePoolingAllocator.ChunkReleasePredicateFALSE_PREDICATEprivate int[]segmentOffsetsprivate intsegmentSize
-
Constructor Summary
Constructors Modifier Constructor Description privateSizeClassChunkController(AdaptivePoolingAllocator.MagazineGroup group, int segmentSize, int chunkSize, int[] segmentOffsets)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcomputeBufferCapacity(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.AdaptivePoolingAllocator.ChunknewChunkAllocation(int promptingSize, AdaptivePoolingAllocator.Magazine magazine)Allocate a newAdaptivePoolingAllocator.Chunkfor the givenAdaptivePoolingAllocator.Magazine.
-
-
-
Field Detail
-
FALSE_PREDICATE
private static final AdaptivePoolingAllocator.ChunkReleasePredicate FALSE_PREDICATE
-
chunkAllocator
private final AdaptivePoolingAllocator.ChunkAllocator chunkAllocator
-
segmentSize
private final int segmentSize
-
chunkSize
private final int chunkSize
-
chunkRegistry
private final AdaptivePoolingAllocator.ChunkRegistry chunkRegistry
-
segmentOffsets
private final int[] segmentOffsets
-
-
Constructor Detail
-
SizeClassChunkController
private SizeClassChunkController(AdaptivePoolingAllocator.MagazineGroup group, int segmentSize, int chunkSize, int[] segmentOffsets)
-
-
Method Detail
-
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
-
initializeSharedStateIn
public void initializeSharedStateIn(AdaptivePoolingAllocator.ChunkController chunkController)
Description copied from interface:AdaptivePoolingAllocator.ChunkControllerInitialize the given chunk factory with shared statistics state (if any) from this factory.- Specified by:
initializeSharedStateInin 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
-
-