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
FieldsModifier and TypeFieldDescriptionprivate final AdaptivePoolingAllocatorprivate final AdaptivePoolingAllocator.ChunkAllocatorprivate final AdaptivePoolingAllocator.ChunkCacheprivate final AdaptivePoolingAllocator.ChunkManagementStrategyprivate booleanprivate final java.util.concurrent.locks.StampedLockprivate AdaptivePoolingAllocator.Magazine[]private java.lang.Threadprivate final AdaptivePoolingAllocator.Magazine -
Constructor Summary
ConstructorsConstructorDescriptionMagazineGroup(AdaptivePoolingAllocator allocator, AdaptivePoolingAllocator.ChunkAllocator chunkAllocator, AdaptivePoolingAllocator.ChunkManagementStrategy chunkManagementStrategy, boolean isThreadLocal) -
Method Summary
Modifier and TypeMethodDescriptionallocate(int size, int maxCapacity, java.lang.Thread currentThread, AdaptivePoolingAllocator.AdaptiveByteBuf buf) private voidfree()private voidfreeChunkReuseQueue(java.lang.Thread ownerThread) (package private) boolean(package private) AdaptivePoolingAllocator.ChunkpollChunk(int size) private booleantryExpandMagazines(int currentLength) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
allocator
-
chunkAllocator
-
chunkManagementStrategy
-
chunkCache
-
magazineExpandLock
private final java.util.concurrent.locks.StampedLock magazineExpandLock -
threadLocalMagazine
-
ownerThread
private java.lang.Thread ownerThread -
magazines
-
freed
private volatile boolean freed
-
-
Constructor Details
-
MagazineGroup
MagazineGroup(AdaptivePoolingAllocator allocator, AdaptivePoolingAllocator.ChunkAllocator chunkAllocator, AdaptivePoolingAllocator.ChunkManagementStrategy chunkManagementStrategy, boolean isThreadLocal)
-
-
Method Details
-
allocate
public AdaptivePoolingAllocator.AdaptiveByteBuf allocate(int size, int maxCapacity, java.lang.Thread currentThread, AdaptivePoolingAllocator.AdaptiveByteBuf buf) -
tryExpandMagazines
private boolean tryExpandMagazines(int currentLength) -
pollChunk
-
offerChunk
-
free
private void free() -
freeChunkReuseQueue
private void freeChunkReuseQueue(java.lang.Thread ownerThread)
-