Home / Function/ Chunk() — netty Function Reference

Chunk() — netty Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  cf3730c9_1042_a858_3557_b0e2bfc53f3d["Chunk()"]
  938adf42_e2a2_8327_31b0_f4ff5165ce47["ConcurrentQueueChunkCache"]
  cf3730c9_1042_a858_3557_b0e2bfc53f3d -->|defined in| 938adf42_e2a2_8327_31b0_f4ff5165ce47
  41230d9d_3792_e2cb_6bf6_5576bee2a05f["size()"]
  cf3730c9_1042_a858_3557_b0e2bfc53f3d -->|calls| 41230d9d_3792_e2cb_6bf6_5576bee2a05f
  04f8cd58_f031_827b_41fb_b7445b790e37["hasUnprocessedFreelistEntries()"]
  cf3730c9_1042_a858_3557_b0e2bfc53f3d -->|calls| 04f8cd58_f031_827b_41fb_b7445b790e37
  64a005fb_49a2_2033_49c6_cbcbad4ec48a["processFreelistEntries()"]
  cf3730c9_1042_a858_3557_b0e2bfc53f3d -->|calls| 64a005fb_49a2_2033_49c6_cbcbad4ec48a
  aa355cc9_0be7_7204_fd7f_51edca001d83["remainingCapacity()"]
  cf3730c9_1042_a858_3557_b0e2bfc53f3d -->|calls| aa355cc9_0be7_7204_fd7f_51edca001d83
  style cf3730c9_1042_a858_3557_b0e2bfc53f3d fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

buffer/src/main/java/io/netty/buffer/AdaptivePoolingAllocator.java lines 531–548

        @Override
        public Chunk pollChunk(int size) {
            int attemps = queue.size();
            for (int i = 0; i < attemps; i++) {
                Chunk chunk = queue.poll();
                if (chunk == null) {
                    return null;
                }
                if (chunk.hasUnprocessedFreelistEntries()) {
                    chunk.processFreelistEntries();
                }
                if (chunk.remainingCapacity() >= size) {
                    return chunk;
                }
                queue.offer(chunk);
            }
            return null;
        }

Domain

Subdomains

Frequently Asked Questions

What does Chunk() do?
Chunk() is a function in the netty codebase, defined in buffer/src/main/java/io/netty/buffer/AdaptivePoolingAllocator.java.
Where is Chunk() defined?
Chunk() is defined in buffer/src/main/java/io/netty/buffer/AdaptivePoolingAllocator.java at line 531.
What does Chunk() call?
Chunk() calls 4 function(s): hasUnprocessedFreelistEntries, processFreelistEntries, remainingCapacity, size.

Analyze Your Own Codebase

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

Try Supermodel Free