Home / Function/ tryExpandMagazines() — netty Function Reference

tryExpandMagazines() — netty Function Reference

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

Function java Buffer Telemetry calls 2 called by 1

Entity Profile

Dependency Diagram

graph TD
  7d98a725_7e43_8a22_908d_604424cb35a1["tryExpandMagazines()"]
  5c7d3ca5_8d2c_76d2_0628_1864f492365d["MagazineGroup"]
  7d98a725_7e43_8a22_908d_604424cb35a1 -->|defined in| 5c7d3ca5_8d2c_76d2_0628_1864f492365d
  080309e4_d57c_ce66_6f51_f105cc6f6710["AdaptiveByteBuf()"]
  080309e4_d57c_ce66_6f51_f105cc6f6710 -->|calls| 7d98a725_7e43_8a22_908d_604424cb35a1
  41097f8a_1d62_d8d9_681a_240be71758b9["Magazine()"]
  7d98a725_7e43_8a22_908d_604424cb35a1 -->|calls| 41097f8a_1d62_d8d9_681a_240be71758b9
  08459dfe_dddb_9dbd_ad3a_4497f81d4b9e["free()"]
  7d98a725_7e43_8a22_908d_604424cb35a1 -->|calls| 08459dfe_dddb_9dbd_ad3a_4497f81d4b9e
  style 7d98a725_7e43_8a22_908d_604424cb35a1 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

buffer/src/main/java/io/netty/buffer/AdaptivePoolingAllocator.java lines 435–460

        private boolean tryExpandMagazines(int currentLength) {
            if (currentLength >= MAX_STRIPES) {
                return true;
            }
            final Magazine[] mags;
            long writeLock = magazineExpandLock.tryWriteLock();
            if (writeLock != 0) {
                try {
                    mags = magazines;
                    if (mags.length >= MAX_STRIPES || mags.length > currentLength || freed) {
                        return true;
                    }
                    Magazine[] expanded = new Magazine[mags.length * 2];
                    for (int i = 0, l = expanded.length; i < l; i++) {
                        expanded[i] = new Magazine(this, true, chunkManagementStrategy.createController(this));
                    }
                    magazines = expanded;
                } finally {
                    magazineExpandLock.unlockWrite(writeLock);
                }
                for (Magazine magazine : mags) {
                    magazine.free();
                }
            }
            return true;
        }

Domain

Subdomains

Called By

Frequently Asked Questions

What does tryExpandMagazines() do?
tryExpandMagazines() is a function in the netty codebase, defined in buffer/src/main/java/io/netty/buffer/AdaptivePoolingAllocator.java.
Where is tryExpandMagazines() defined?
tryExpandMagazines() is defined in buffer/src/main/java/io/netty/buffer/AdaptivePoolingAllocator.java at line 435.
What does tryExpandMagazines() call?
tryExpandMagazines() calls 2 function(s): Magazine, free.
What calls tryExpandMagazines()?
tryExpandMagazines() is called by 1 function(s): AdaptiveByteBuf.

Analyze Your Own Codebase

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

Try Supermodel Free