Home / Class/ InstrumentedUnpooledUnsafeHeapByteBuf Class — netty Architecture

InstrumentedUnpooledUnsafeHeapByteBuf Class — netty Architecture

Architecture documentation for the InstrumentedUnpooledUnsafeHeapByteBuf class in UnpooledByteBufAllocator.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  8812e0ee_236a_725e_105a_895da5075478["InstrumentedUnpooledUnsafeHeapByteBuf"]
  0b4b2671_fb24_9a0d_bc3a_aef00ae524b0["UnpooledByteBufAllocator.java"]
  8812e0ee_236a_725e_105a_895da5075478 -->|defined in| 0b4b2671_fb24_9a0d_bc3a_aef00ae524b0
  de103f0f_a4ea_df95_1089_299a5704b304["InstrumentedUnpooledUnsafeHeapByteBuf()"]
  8812e0ee_236a_725e_105a_895da5075478 -->|method| de103f0f_a4ea_df95_1089_299a5704b304
  7fe91473_e539_4684_c2bb_100b00a72d23["allocateArray()"]
  8812e0ee_236a_725e_105a_895da5075478 -->|method| 7fe91473_e539_4684_c2bb_100b00a72d23
  a5c85114_12de_8699_87a3_a5bd83bbfbcb["freeArray()"]
  8812e0ee_236a_725e_105a_895da5075478 -->|method| a5c85114_12de_8699_87a3_a5bd83bbfbcb

Relationship Graph

Source Code

buffer/src/main/java/io/netty/buffer/UnpooledByteBufAllocator.java lines 138–156

    private static final class InstrumentedUnpooledUnsafeHeapByteBuf extends UnpooledUnsafeHeapByteBuf {
        InstrumentedUnpooledUnsafeHeapByteBuf(UnpooledByteBufAllocator alloc, int initialCapacity, int maxCapacity) {
            super(alloc, initialCapacity, maxCapacity);
        }

        @Override
        protected byte[] allocateArray(int initialCapacity) {
            byte[] bytes = super.allocateArray(initialCapacity);
            ((UnpooledByteBufAllocator) alloc()).incrementHeap(bytes.length);
            return bytes;
        }

        @Override
        protected void freeArray(byte[] array) {
            int length = array.length;
            super.freeArray(array);
            ((UnpooledByteBufAllocator) alloc()).decrementHeap(length);
        }
    }

Frequently Asked Questions

What is the InstrumentedUnpooledUnsafeHeapByteBuf class?
InstrumentedUnpooledUnsafeHeapByteBuf is a class in the netty codebase, defined in buffer/src/main/java/io/netty/buffer/UnpooledByteBufAllocator.java.
Where is InstrumentedUnpooledUnsafeHeapByteBuf defined?
InstrumentedUnpooledUnsafeHeapByteBuf is defined in buffer/src/main/java/io/netty/buffer/UnpooledByteBufAllocator.java at line 138.

Analyze Your Own Codebase

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

Try Supermodel Free