Home / Function/ deallocate() — netty Function Reference

deallocate() — netty Function Reference

Architecture documentation for the deallocate() function in AbstractPooledDerivedByteBuf.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  30b54926_0478_2b0c_6b71_8d6acf5db7f0["deallocate()"]
  71f0dee8_a776_7a4e_70f9_33ece338c7c8["AbstractPooledDerivedByteBuf"]
  30b54926_0478_2b0c_6b71_8d6acf5db7f0 -->|defined in| 71f0dee8_a776_7a4e_70f9_33ece338c7c8
  style 30b54926_0478_2b0c_6b71_8d6acf5db7f0 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

buffer/src/main/java/io/netty/buffer/AbstractPooledDerivedByteBuf.java lines 85–95

    @Override
    protected final void deallocate() {
        // We need to first store a reference to the parent before recycle this instance. This is needed as
        // otherwise it is possible that the same AbstractPooledDerivedByteBuf is again obtained and init(...) is
        // called before we actually have a chance to call release(). This leads to call release() on the wrong parent.
        ByteBuf parent = this.parent;
        // Remove references to parent and root so that they can be GCed for leak detection [netty/netty#14247]
        this.parent = this.rootParent = null;
        recyclerHandle.unguardedRecycle(this);
        parent.release();
    }

Domain

Subdomains

Frequently Asked Questions

What does deallocate() do?
deallocate() is a function in the netty codebase, defined in buffer/src/main/java/io/netty/buffer/AbstractPooledDerivedByteBuf.java.
Where is deallocate() defined?
deallocate() is defined in buffer/src/main/java/io/netty/buffer/AbstractPooledDerivedByteBuf.java at line 85.

Analyze Your Own Codebase

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

Try Supermodel Free