Package io.netty.buffer
Class AdaptivePoolingAllocator.Magazine
- java.lang.Object
-
- io.netty.buffer.AdaptivePoolingAllocator.Magazine
-
- Enclosing class:
- AdaptivePoolingAllocator
private static final class AdaptivePoolingAllocator.Magazine extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classAdaptivePoolingAllocator.Magazine.AdaptiveRecycler
-
Field Summary
Fields Modifier and Type Field Description private java.util.concurrent.locks.StampedLockallocationLockprivate AdaptivePoolingAllocator.ChunkControllerchunkControllerprivate AdaptivePoolingAllocator.Chunkcurrentprivate static AdaptivePoolingAllocator.Magazine.AdaptiveRecyclerEVENT_LOOP_LOCAL_BUFFER_POOLprivate AdaptivePoolingAllocator.MagazineGroupgroupprivate static AdaptivePoolingAllocator.ChunkMAGAZINE_FREEDprivate static java.util.concurrent.atomic.AtomicReferenceFieldUpdater<AdaptivePoolingAllocator.Magazine,AdaptivePoolingAllocator.Chunk>NEXT_IN_LINEprivate AdaptivePoolingAllocator.ChunknextInLineprivate AdaptivePoolingAllocator.Magazine.AdaptiveRecyclerrecycler
-
Constructor Summary
Constructors Constructor Description Magazine(AdaptivePoolingAllocator.MagazineGroup group, boolean shareable, AdaptivePoolingAllocator.ChunkController chunkController)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private booleanallocate(int size, int maxCapacity, AdaptivePoolingAllocator.AdaptiveByteBuf buf, boolean reallocate)private booleanallocateWithoutLock(int size, int maxCapacity, AdaptivePoolingAllocator.AdaptiveByteBuf buf)(package private) voidfree()AdaptivePoolingAllocator.AdaptiveByteBufnewBuffer()(package private) booleanofferToQueue(AdaptivePoolingAllocator.Chunk chunk)private voidrestoreMagazineFreed()private voidtransferToNextInLineOrRelease(AdaptivePoolingAllocator.Chunk chunk)booleantryAllocate(int size, int maxCapacity, AdaptivePoolingAllocator.AdaptiveByteBuf buf, boolean reallocate)
-
-
-
Field Detail
-
NEXT_IN_LINE
private static final java.util.concurrent.atomic.AtomicReferenceFieldUpdater<AdaptivePoolingAllocator.Magazine,AdaptivePoolingAllocator.Chunk> NEXT_IN_LINE
-
MAGAZINE_FREED
private static final AdaptivePoolingAllocator.Chunk MAGAZINE_FREED
-
EVENT_LOOP_LOCAL_BUFFER_POOL
private static final AdaptivePoolingAllocator.Magazine.AdaptiveRecycler EVENT_LOOP_LOCAL_BUFFER_POOL
-
current
private AdaptivePoolingAllocator.Chunk current
-
nextInLine
private volatile AdaptivePoolingAllocator.Chunk nextInLine
-
group
private final AdaptivePoolingAllocator.MagazineGroup group
-
chunkController
private final AdaptivePoolingAllocator.ChunkController chunkController
-
allocationLock
private final java.util.concurrent.locks.StampedLock allocationLock
-
recycler
private final AdaptivePoolingAllocator.Magazine.AdaptiveRecycler recycler
-
-
Constructor Detail
-
Magazine
Magazine(AdaptivePoolingAllocator.MagazineGroup group, boolean shareable, AdaptivePoolingAllocator.ChunkController chunkController)
-
-
Method Detail
-
tryAllocate
public boolean tryAllocate(int size, int maxCapacity, AdaptivePoolingAllocator.AdaptiveByteBuf buf, boolean reallocate)
-
allocateWithoutLock
private boolean allocateWithoutLock(int size, int maxCapacity, AdaptivePoolingAllocator.AdaptiveByteBuf buf)
-
allocate
private boolean allocate(int size, int maxCapacity, AdaptivePoolingAllocator.AdaptiveByteBuf buf, boolean reallocate)
-
restoreMagazineFreed
private void restoreMagazineFreed()
-
transferToNextInLineOrRelease
private void transferToNextInLineOrRelease(AdaptivePoolingAllocator.Chunk chunk)
-
free
void free()
-
newBuffer
public AdaptivePoolingAllocator.AdaptiveByteBuf newBuffer()
-
offerToQueue
boolean offerToQueue(AdaptivePoolingAllocator.Chunk chunk)
-
-