Home / Function/ retain0() — netty Function Reference

retain0() — netty Function Reference

Architecture documentation for the retain0() function in RefCnt.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  c7f19423_c5ad_a4f9_dc2f_3164b088e51a["retain0()"]
  a43fdad8_805c_4b48_edc8_5658c1df4216["UnsafeRefCnt"]
  c7f19423_c5ad_a4f9_dc2f_3164b088e51a -->|defined in| a43fdad8_805c_4b48_edc8_5658c1df4216
  2f9c7e0d_83e1_98fc_1a83_b1192ccb6094["retain0()"]
  c7f19423_c5ad_a4f9_dc2f_3164b088e51a -->|calls| 2f9c7e0d_83e1_98fc_1a83_b1192ccb6094
  style c7f19423_c5ad_a4f9_dc2f_3164b088e51a fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

common/src/main/java/io/netty/util/internal/RefCnt.java lines 424–433

        private static void retain0(RefCnt instance, int increment) {
            // oldRef & 0x80000001 stands for oldRef < 0 || oldRef is odd
            // NOTE: we're optimizing for inlined and constant folded increment here -> which will make
            // Integer.MAX_VALUE - increment to be computed at compile time
            int oldRef = PlatformDependent.getAndAddInt(instance, VALUE_OFFSET, increment);
            if ((oldRef & 0x80000001) != 0 || oldRef > Integer.MAX_VALUE - increment) {
                PlatformDependent.getAndAddInt(instance, VALUE_OFFSET, -increment);
                throw new IllegalReferenceCountException(0, increment >>> 1);
            }
        }

Domain

Subdomains

Calls

Frequently Asked Questions

What does retain0() do?
retain0() is a function in the netty codebase, defined in common/src/main/java/io/netty/util/internal/RefCnt.java.
Where is retain0() defined?
retain0() is defined in common/src/main/java/io/netty/util/internal/RefCnt.java at line 424.
What does retain0() call?
retain0() calls 1 function(s): retain0.

Analyze Your Own Codebase

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

Try Supermodel Free