Home / Function/ readInitInto() — netty Function Reference

readInitInto() — netty Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  a13d9512_d928_e5c6_faed_67181d87b829["readInitInto()"]
  fbf1f415_2f80_8493_e5fb_f8f9be5f99ee["BuddyChunk"]
  a13d9512_d928_e5c6_faed_67181d87b829 -->|defined in| fbf1f415_2f80_8493_e5fb_f8f9be5f99ee
  1fed9ab7_5a1d_51fc_3bb4_e5426c8fe9db["isEmpty()"]
  a13d9512_d928_e5c6_faed_67181d87b829 -->|calls| 1fed9ab7_5a1d_51fc_3bb4_e5426c8fe9db
  09ad62f1_655a_04ec_8e0e_51a3c352654d["chooseFirstFreeBuddy()"]
  a13d9512_d928_e5c6_faed_67181d87b829 -->|calls| 09ad62f1_655a_04ec_8e0e_51a3c352654d
  d9980d84_8510_b798_28d8_a0722eb609cd["retain()"]
  a13d9512_d928_e5c6_faed_67181d87b829 -->|calls| d9980d84_8510_b798_28d8_a0722eb609cd
  d2358321_df26_0835_b350_5f8d6d0f0433["init()"]
  a13d9512_d928_e5c6_faed_67181d87b829 -->|calls| d2358321_df26_0835_b350_5f8d6d0f0433
  59c1d0ae_e507_0c96_51fa_359fe1b6411f["release()"]
  a13d9512_d928_e5c6_faed_67181d87b829 -->|calls| 59c1d0ae_e507_0c96_51fa_359fe1b6411f
  5b606370_5e08_94d5_b745_9c0ce73ce25a["readInitInto()"]
  a13d9512_d928_e5c6_faed_67181d87b829 -->|calls| 5b606370_5e08_94d5_b745_9c0ce73ce25a
  style a13d9512_d928_e5c6_faed_67181d87b829 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

buffer/src/main/java/io/netty/buffer/AdaptivePoolingAllocator.java lines 1394–1417

        @Override
        public boolean readInitInto(AdaptiveByteBuf buf, int size, int startingCapacity, int maxCapacity) {
            if (!freeList.isEmpty()) {
                freeList.drain(freeListCapacity, this);
            }
            int startIndex = chooseFirstFreeBuddy(1, startingCapacity, 0);
            if (startIndex == -1) {
                return false;
            }
            Chunk chunk = this;
            chunk.retain();
            try {
                buf.init(delegate, this, 0, 0, startIndex, size, startingCapacity, maxCapacity);
                allocatedBytes += startingCapacity;
                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(...).
                    chunk.release();
                }
            }
            return true;
        }

Domain

Subdomains

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 1394.
What does readInitInto() call?
readInitInto() calls 6 function(s): chooseFirstFreeBuddy, init, isEmpty, readInitInto, release, retain.

Analyze Your Own Codebase

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

Try Supermodel Free