Package io.netty.buffer
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
Fields Modifier and Type Field Description private static intFREE_LIST_EMPTYprivate MpscIntQueuefreeListprivate intsegmentSize-
Fields inherited from class io.netty.buffer.AdaptivePoolingAllocator.Chunk
allocatedBytes, delegate, magazine
-
-
Constructor Summary
Constructors Constructor Description SizeClassedChunk(AbstractByteBuf delegate, AdaptivePoolingAllocator.Magazine magazine, boolean pooled, int segmentSize, int[] segmentOffsets, AdaptivePoolingAllocator.ChunkReleasePredicate shouldReleaseChunk)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidreadInitInto(AdaptivePoolingAllocator.AdaptiveByteBuf buf, int size, int startingCapacity, int maxCapacity)(package private) booleanreleaseFromMagazine()Called 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.intremainingCapacity()-
Methods inherited from class io.netty.buffer.AdaptivePoolingAllocator.Chunk
attachToMagazine, capacity, currentMagazine, detachFromMagazine, refCnt, release, release, retain, retain, touch, touch
-
-
-
-
Field Detail
-
FREE_LIST_EMPTY
private static final int FREE_LIST_EMPTY
- See Also:
- Constant Field Values
-
segmentSize
private final int segmentSize
-
freeList
private final MpscIntQueue freeList
-
-
Constructor Detail
-
SizeClassedChunk
SizeClassedChunk(AbstractByteBuf delegate, AdaptivePoolingAllocator.Magazine magazine, boolean pooled, int segmentSize, int[] segmentOffsets, AdaptivePoolingAllocator.ChunkReleasePredicate shouldReleaseChunk)
-
-
Method Detail
-
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
-
-