Class AdaptivePoolingAllocator.Chunk
java.lang.Object
io.netty.buffer.AdaptivePoolingAllocator.Chunk
- All Implemented Interfaces:
ChunkInfo
- Direct Known Subclasses:
AdaptivePoolingAllocator.BuddyChunk, AdaptivePoolingAllocator.SizeClassedChunk
- Enclosing class:
AdaptivePoolingAllocator
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprivate final AdaptivePoolingAllocatorprivate final intprotected final AbstractByteBufprotected AdaptivePoolingAllocator.Magazineprivate final booleanprivate final RefCnt -
Constructor Summary
ConstructorsConstructorDescriptionChunk()Chunk(AbstractByteBuf delegate, AdaptivePoolingAllocator.Magazine magazine, boolean pooled) -
Method Summary
Modifier and TypeMethodDescription(package private) voidintcapacity()The capacity of the chunk, in bytes.(package private) AdaptivePoolingAllocator.Magazineprotected void(package private) voidbooleanbooleanisDirect()trueif the chunk contain native memory, otherwisefalse.(package private) voidlongThe native memory address of the chunk, if any, otherwise zero.private voidvoidbooleanreadInitInto(AdaptivePoolingAllocator.AdaptiveByteBuf buf, int size, int startingCapacity, int maxCapacity) protected booleanrelease()(package private) voidCalled when a magazine is done using this chunk, probably because it was emptied.(package private) voidreleaseSegment(int ignoredSegmentId, int size) Called when a ByteBuf is done using its allocation in this chunk.intprivate voidretain()
-
Field Details
-
delegate
-
magazine
-
allocator
-
refCnt
-
capacity
private final int capacity -
pooled
private final boolean pooled -
allocatedBytes
protected int allocatedBytes
-
-
Constructor Details
-
Chunk
Chunk() -
Chunk
Chunk(AbstractByteBuf delegate, AdaptivePoolingAllocator.Magazine magazine, boolean pooled)
-
-
Method Details
-
currentMagazine
AdaptivePoolingAllocator.Magazine currentMagazine() -
detachFromMagazine
void detachFromMagazine() -
attachToMagazine
-
releaseFromMagazine
void releaseFromMagazine()Called when a magazine is done using this chunk, probably because it was emptied. -
releaseSegment
void releaseSegment(int ignoredSegmentId, int size) Called when a ByteBuf is done using its allocation in this chunk. -
markToDeallocate
void markToDeallocate() -
retain
private void retain() -
release
protected boolean release() -
deallocate
protected void deallocate() -
onRelease
private void onRelease() -
readInitInto
public boolean readInitInto(AdaptivePoolingAllocator.AdaptiveByteBuf buf, int size, int startingCapacity, int maxCapacity) -
remainingCapacity
public int remainingCapacity() -
hasUnprocessedFreelistEntries
public boolean hasUnprocessedFreelistEntries() -
processFreelistEntries
public void processFreelistEntries() -
capacity
-
isDirect
-
memoryAddress
public long memoryAddress()Description copied from interface:ChunkInfoThe native memory address of the chunk, if any, otherwise zero.- Specified by:
memoryAddressin interfaceChunkInfo
-