Class AdaptivePoolingAllocator.SizeClassedChunk
java.lang.Object
io.netty.buffer.AdaptivePoolingAllocator.Chunk
io.netty.buffer.AdaptivePoolingAllocator.SizeClassedChunk
- All Implemented Interfaces:
ReferenceCounted
- Enclosing class:
AdaptivePoolingAllocator
private static final class AdaptivePoolingAllocator.SizeClassedChunk
extends AdaptivePoolingAllocator.Chunk
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intprivate final MpscIntQueueprivate final intFields inherited from class AdaptivePoolingAllocator.Chunk
allocatedBytes, delegate, magazine -
Constructor Summary
ConstructorsConstructorDescriptionSizeClassedChunk(AbstractByteBuf delegate, AdaptivePoolingAllocator.Magazine magazine, boolean pooled, int segmentSize, int[] segmentOffsets, AdaptivePoolingAllocator.ChunkReleasePredicate shouldReleaseChunk) -
Method Summary
Modifier and TypeMethodDescriptionvoidreadInitInto(AdaptivePoolingAllocator.AdaptiveByteBuf buf, int size, int startingCapacity, int maxCapacity) (package private) booleanCalled when a magazine is done using this chunk, probably because it was emptied.(package private) booleanreleaseSegment(int startIndex) Called when a ByteBuf is done using its allocation in this chunk.intMethods inherited from class AdaptivePoolingAllocator.Chunk
attachToMagazine, capacity, currentMagazine, detachFromMagazine, refCnt, release, release, retain, retain, touch, touch
-
Field Details
-
FREE_LIST_EMPTY
private static final int FREE_LIST_EMPTY- See Also:
-
segmentSize
private final int segmentSize -
freeList
-
-
Constructor Details
-
SizeClassedChunk
SizeClassedChunk(AbstractByteBuf delegate, AdaptivePoolingAllocator.Magazine magazine, boolean pooled, int segmentSize, int[] segmentOffsets, AdaptivePoolingAllocator.ChunkReleasePredicate shouldReleaseChunk)
-
-
Method Details
-
readInitInto
public void readInitInto(AdaptivePoolingAllocator.AdaptiveByteBuf buf, int size, int startingCapacity, int maxCapacity) - Overrides:
readInitIntoin classAdaptivePoolingAllocator.Chunk
-
remainingCapacity
public int remainingCapacity()- Overrides:
remainingCapacityin classAdaptivePoolingAllocator.Chunk
-
releaseFromMagazine
boolean releaseFromMagazine()Description copied from class:AdaptivePoolingAllocator.ChunkCalled when a magazine is done using this chunk, probably because it was emptied.- Overrides:
releaseFromMagazinein classAdaptivePoolingAllocator.Chunk
-
releaseSegment
boolean releaseSegment(int startIndex) Description copied from class:AdaptivePoolingAllocator.ChunkCalled when a ByteBuf is done using its allocation in this chunk.- Overrides:
releaseSegmentin classAdaptivePoolingAllocator.Chunk
-