Home / Function/ readInitInto() — netty Function Reference

readInitInto() — netty Function Reference

Architecture documentation for the readInitInto() function in AdaptivePoolingAllocator.java from the netty codebase.

Function java Buffer Telemetry calls 5 called by 1

Entity Profile

Dependency Diagram

graph TD
  124af09c_056b_fca2_ab69_30a58e494d89["readInitInto()"]
  0786b48a_6931_326c_822b_73a96aca1827["SizeClassedChunk"]
  124af09c_056b_fca2_ab69_30a58e494d89 -->|defined in| 0786b48a_6931_326c_822b_73a96aca1827
  5b606370_5e08_94d5_b745_9c0ce73ce25a["readInitInto()"]
  5b606370_5e08_94d5_b745_9c0ce73ce25a -->|calls| 124af09c_056b_fca2_ab69_30a58e494d89
  1c99e4d1_eab5_0574_2be2_1d396456cf4d["nextAvailableSegmentOffset()"]
  124af09c_056b_fca2_ab69_30a58e494d89 -->|calls| 1c99e4d1_eab5_0574_2be2_1d396456cf4d
  d9980d84_8510_b798_28d8_a0722eb609cd["retain()"]
  124af09c_056b_fca2_ab69_30a58e494d89 -->|calls| d9980d84_8510_b798_28d8_a0722eb609cd
  d2358321_df26_0835_b350_5f8d6d0f0433["init()"]
  124af09c_056b_fca2_ab69_30a58e494d89 -->|calls| d2358321_df26_0835_b350_5f8d6d0f0433
  5b606370_5e08_94d5_b745_9c0ce73ce25a["readInitInto()"]
  124af09c_056b_fca2_ab69_30a58e494d89 -->|calls| 5b606370_5e08_94d5_b745_9c0ce73ce25a
  f1f91104_8721_329c_3138_235bb4f03863["releaseSegment()"]
  124af09c_056b_fca2_ab69_30a58e494d89 -->|calls| f1f91104_8721_329c_3138_235bb4f03863
  style 124af09c_056b_fca2_ab69_30a58e494d89 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

buffer/src/main/java/io/netty/buffer/AdaptivePoolingAllocator.java lines 1273–1295

        @Override
        public boolean readInitInto(AdaptiveByteBuf buf, int size, int startingCapacity, int maxCapacity) {
            final int startIndex = nextAvailableSegmentOffset();
            if (startIndex == FREE_LIST_EMPTY) {
                return false;
            }
            allocatedBytes += segmentSize;
            Chunk chunk = this;
            chunk.retain();
            try {
                buf.init(delegate, chunk, 0, 0, startIndex, size, startingCapacity, maxCapacity);
                chunk = null;
            } finally {
                if (chunk != null) {
                    // If chunk is not null we know that buf.init(...) failed and so we need to manually release
                    // the chunk again as we retained it before calling buf.init(...). Beside this we also need to
                    // restore the old allocatedBytes value.
                    allocatedBytes -= segmentSize;
                    chunk.releaseSegment(startIndex, startingCapacity);
                }
            }
            return true;
        }

Domain

Subdomains

Called By

Frequently Asked Questions

What does readInitInto() do?
readInitInto() is a function in the netty codebase, defined in buffer/src/main/java/io/netty/buffer/AdaptivePoolingAllocator.java.
Where is readInitInto() defined?
readInitInto() is defined in buffer/src/main/java/io/netty/buffer/AdaptivePoolingAllocator.java at line 1273.
What does readInitInto() call?
readInitInto() calls 5 function(s): init, nextAvailableSegmentOffset, readInitInto, releaseSegment, retain.
What calls readInitInto()?
readInitInto() is called by 1 function(s): readInitInto.

Analyze Your Own Codebase

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

Try Supermodel Free