Package io.netty.buffer
Class AdaptivePoolingAllocator.BuddyChunkController
- java.lang.Object
-
- io.netty.buffer.AdaptivePoolingAllocator.BuddyChunkController
-
- All Implemented Interfaces:
AdaptivePoolingAllocator.ChunkController
- Enclosing class:
- AdaptivePoolingAllocator
private static final class AdaptivePoolingAllocator.BuddyChunkController extends java.lang.Object implements AdaptivePoolingAllocator.ChunkController
-
-
Field Summary
Fields Modifier and Type Field Description private AdaptivePoolingAllocator.ChunkAllocatorchunkAllocatorprivate AdaptivePoolingAllocator.ChunkRegistrychunkRegistryprivate java.util.concurrent.atomic.AtomicIntegermaxChunkSize
-
Constructor Summary
Constructors Constructor Description BuddyChunkController(AdaptivePoolingAllocator.MagazineGroup group, java.util.concurrent.atomic.AtomicInteger maxChunkSize)
-
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.AdaptivePoolingAllocator.ChunknewChunkAllocation(int promptingSize, AdaptivePoolingAllocator.Magazine magazine)Allocate a newAdaptivePoolingAllocator.Chunkfor the givenAdaptivePoolingAllocator.Magazine.
-
-
-
Field Detail
-
chunkAllocator
private final AdaptivePoolingAllocator.ChunkAllocator chunkAllocator
-
chunkRegistry
private final AdaptivePoolingAllocator.ChunkRegistry chunkRegistry
-
maxChunkSize
private final java.util.concurrent.atomic.AtomicInteger maxChunkSize
-
-
Constructor Detail
-
BuddyChunkController
BuddyChunkController(AdaptivePoolingAllocator.MagazineGroup group, java.util.concurrent.atomic.AtomicInteger maxChunkSize)
-
-
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
-
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
-
-