HeapChunkAllocator Class — netty Architecture
Architecture documentation for the HeapChunkAllocator class in AdaptiveByteBufAllocator.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD c4a01655_0ef2_f332_8850_cf568ad1bc01["HeapChunkAllocator"] 6b49ef9c_b171_f31a_8052_bb3056b414c3["AdaptiveByteBufAllocator.java"] c4a01655_0ef2_f332_8850_cf568ad1bc01 -->|defined in| 6b49ef9c_b171_f31a_8052_bb3056b414c3 a9679231_79ce_1c9d_73bc_17126670b78f["HeapChunkAllocator()"] c4a01655_0ef2_f332_8850_cf568ad1bc01 -->|method| a9679231_79ce_1c9d_73bc_17126670b78f e74767ff_8736_bf50_dbd2_2a291dbceee0["AbstractByteBuf()"] c4a01655_0ef2_f332_8850_cf568ad1bc01 -->|method| e74767ff_8736_bf50_dbd2_2a291dbceee0
Relationship Graph
Source Code
buffer/src/main/java/io/netty/buffer/AdaptiveByteBufAllocator.java lines 90–103
private static final class HeapChunkAllocator implements AdaptivePoolingAllocator.ChunkAllocator {
private final ByteBufAllocator allocator;
private HeapChunkAllocator(ByteBufAllocator allocator) {
this.allocator = allocator;
}
@Override
public AbstractByteBuf allocate(int initialCapacity, int maxCapacity) {
return PlatformDependent.hasUnsafe() ?
new UnpooledUnsafeHeapByteBuf(allocator, initialCapacity, maxCapacity) :
new UnpooledHeapByteBuf(allocator, initialCapacity, maxCapacity);
}
}
Source
Frequently Asked Questions
What is the HeapChunkAllocator class?
HeapChunkAllocator is a class in the netty codebase, defined in buffer/src/main/java/io/netty/buffer/AdaptiveByteBufAllocator.java.
Where is HeapChunkAllocator defined?
HeapChunkAllocator is defined in buffer/src/main/java/io/netty/buffer/AdaptiveByteBufAllocator.java at line 90.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free