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 ClassesModifier and TypeClassDescriptionprivate static final class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final java.util.concurrent.locks.StampedLockprivate final AdaptivePoolingAllocator.ChunkControllerprivate AdaptivePoolingAllocator.Chunkprivate static final AdaptivePoolingAllocator.Magazine.AdaptiveRecyclerprivate final AdaptivePoolingAllocator.MagazineGroupprivate static final AdaptivePoolingAllocator.Chunkprivate static final java.util.concurrent.atomic.AtomicReferenceFieldUpdater<AdaptivePoolingAllocator.Magazine, AdaptivePoolingAllocator.Chunk> private AdaptivePoolingAllocator.Chunkprivate final AdaptivePoolingAllocator.Magazine.AdaptiveRecycler -
Constructor Summary
ConstructorsConstructorDescriptionMagazine(AdaptivePoolingAllocator.MagazineGroup group, boolean shareable, AdaptivePoolingAllocator.ChunkController chunkController) -
Method Summary
Modifier and TypeMethodDescriptionprivate booleanallocate(int size, int maxCapacity, AdaptivePoolingAllocator.AdaptiveByteBuf buf, boolean reallocate) private booleanallocateWithoutLock(int size, int maxCapacity, AdaptivePoolingAllocator.AdaptiveByteBuf buf) (package private) voidfree()(package private) booleanprivate voidprivate voidbooleantryAllocate(int size, int maxCapacity, AdaptivePoolingAllocator.AdaptiveByteBuf buf, boolean reallocate) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
NEXT_IN_LINE
private static final java.util.concurrent.atomic.AtomicReferenceFieldUpdater<AdaptivePoolingAllocator.Magazine, AdaptivePoolingAllocator.Chunk> NEXT_IN_LINE -
MAGAZINE_FREED
-
EVENT_LOOP_LOCAL_BUFFER_POOL
private static final AdaptivePoolingAllocator.Magazine.AdaptiveRecycler EVENT_LOOP_LOCAL_BUFFER_POOL -
current
-
nextInLine
-
group
-
chunkController
-
allocationLock
private final java.util.concurrent.locks.StampedLock allocationLock -
recycler
-
-
Constructor Details
-
Magazine
Magazine(AdaptivePoolingAllocator.MagazineGroup group, boolean shareable, AdaptivePoolingAllocator.ChunkController chunkController)
-
-
Method Details
-
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
-
free
void free() -
newBuffer
-
offerToQueue
-