Home / Class/ DirectChunkAllocator Class — netty Architecture

DirectChunkAllocator Class — netty Architecture

Architecture documentation for the DirectChunkAllocator class in AdaptiveByteBufAllocator.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  47d4130c_0174_6ba7_2d36_cdc83ef9feb8["DirectChunkAllocator"]
  6b49ef9c_b171_f31a_8052_bb3056b414c3["AdaptiveByteBufAllocator.java"]
  47d4130c_0174_6ba7_2d36_cdc83ef9feb8 -->|defined in| 6b49ef9c_b171_f31a_8052_bb3056b414c3
  30d43aee_9255_6c17_7de0_bc913a7d20a5["DirectChunkAllocator()"]
  47d4130c_0174_6ba7_2d36_cdc83ef9feb8 -->|method| 30d43aee_9255_6c17_7de0_bc913a7d20a5
  5acac87b_5eb1_28c5_5029_23ae5ffc6c2a["AbstractByteBuf()"]
  47d4130c_0174_6ba7_2d36_cdc83ef9feb8 -->|method| 5acac87b_5eb1_28c5_5029_23ae5ffc6c2a

Relationship Graph

Source Code

buffer/src/main/java/io/netty/buffer/AdaptiveByteBufAllocator.java lines 105–118

    private static final class DirectChunkAllocator implements AdaptivePoolingAllocator.ChunkAllocator {
        private final ByteBufAllocator allocator;

        private DirectChunkAllocator(ByteBufAllocator allocator) {
            this.allocator = allocator;
        }

        @Override
        public AbstractByteBuf allocate(int initialCapacity, int maxCapacity) {
            return PlatformDependent.hasUnsafe() ?
                    UnsafeByteBufUtil.newUnsafeDirectByteBuf(allocator, initialCapacity, maxCapacity) :
                    new UnpooledDirectByteBuf(allocator, initialCapacity, maxCapacity);
        }
    }

Frequently Asked Questions

What is the DirectChunkAllocator class?
DirectChunkAllocator is a class in the netty codebase, defined in buffer/src/main/java/io/netty/buffer/AdaptiveByteBufAllocator.java.
Where is DirectChunkAllocator defined?
DirectChunkAllocator is defined in buffer/src/main/java/io/netty/buffer/AdaptiveByteBufAllocator.java at line 105.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free