Package io.netty.buffer
Class AdaptivePoolingAllocator.MagazineGroup
- java.lang.Object
-
- io.netty.buffer.AdaptivePoolingAllocator.MagazineGroup
-
- Enclosing class:
- AdaptivePoolingAllocator
private static final class AdaptivePoolingAllocator.MagazineGroup extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private AdaptivePoolingAllocatorallocatorprivate AdaptivePoolingAllocator.ChunkAllocatorchunkAllocatorprivate AdaptivePoolingAllocator.ChunkControllerFactorychunkControllerFactoryprivate java.util.Queue<AdaptivePoolingAllocator.Chunk>chunkReuseQueueprivate booleanfreedprivate java.util.concurrent.locks.StampedLockmagazineExpandLockprivate AdaptivePoolingAllocator.Magazine[]magazinesprivate AdaptivePoolingAllocator.MagazinethreadLocalMagazine
-
Constructor Summary
Constructors Constructor Description MagazineGroup(AdaptivePoolingAllocator allocator, AdaptivePoolingAllocator.ChunkAllocator chunkAllocator, AdaptivePoolingAllocator.ChunkControllerFactory chunkControllerFactory, boolean isThreadLocal)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AdaptivePoolingAllocator.AdaptiveByteBufallocate(int size, int maxCapacity, java.lang.Thread currentThread, AdaptivePoolingAllocator.AdaptiveByteBuf buf)private voidfree()private voidfreeChunkReuseQueue()(package private) booleanofferToQueue(AdaptivePoolingAllocator.Chunk buffer)private booleantryExpandMagazines(int currentLength)
-
-
-
Field Detail
-
allocator
private final AdaptivePoolingAllocator allocator
-
chunkAllocator
private final AdaptivePoolingAllocator.ChunkAllocator chunkAllocator
-
chunkControllerFactory
private final AdaptivePoolingAllocator.ChunkControllerFactory chunkControllerFactory
-
chunkReuseQueue
private final java.util.Queue<AdaptivePoolingAllocator.Chunk> chunkReuseQueue
-
magazineExpandLock
private final java.util.concurrent.locks.StampedLock magazineExpandLock
-
threadLocalMagazine
private final AdaptivePoolingAllocator.Magazine threadLocalMagazine
-
magazines
private volatile AdaptivePoolingAllocator.Magazine[] magazines
-
freed
private volatile boolean freed
-
-
Constructor Detail
-
MagazineGroup
MagazineGroup(AdaptivePoolingAllocator allocator, AdaptivePoolingAllocator.ChunkAllocator chunkAllocator, AdaptivePoolingAllocator.ChunkControllerFactory chunkControllerFactory, boolean isThreadLocal)
-
-
Method Detail
-
allocate
public AdaptivePoolingAllocator.AdaptiveByteBuf allocate(int size, int maxCapacity, java.lang.Thread currentThread, AdaptivePoolingAllocator.AdaptiveByteBuf buf)
-
tryExpandMagazines
private boolean tryExpandMagazines(int currentLength)
-
offerToQueue
boolean offerToQueue(AdaptivePoolingAllocator.Chunk buffer)
-
free
private void free()
-
freeChunkReuseQueue
private void freeChunkReuseQueue()
-
-