size() — netty Function Reference
Architecture documentation for the size() function in MpscIntQueue.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD 16657c3a_e2e7_fd92_b734_85f139e981e7["size()"] c00a7e8d_e19a_6d4a_6887_5d0634281bed["MpscAtomicIntegerArrayQueue"] 16657c3a_e2e7_fd92_b734_85f139e981e7 -->|defined in| c00a7e8d_e19a_6d4a_6887_5d0634281bed a6577b96_ac1f_02a7_4a84_eb562e174042["drain()"] a6577b96_ac1f_02a7_4a84_eb562e174042 -->|calls| 16657c3a_e2e7_fd92_b734_85f139e981e7 style 16657c3a_e2e7_fd92_b734_85f139e981e7 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
common/src/main/java/io/netty/util/concurrent/MpscIntQueue.java lines 255–270
@Override
public int size() {
// Loop until we get a consistent read of both the consumer and producer indices.
long after = consumerIndex;
long size;
for (;;) {
long before = after;
long pIndex = producerIndex;
after = consumerIndex;
if (before == after) {
size = pIndex - after;
break;
}
}
return size < 0 ? 0 : size > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int) size;
}
Domain
Subdomains
Called By
Source
Frequently Asked Questions
What does size() do?
size() is a function in the netty codebase, defined in common/src/main/java/io/netty/util/concurrent/MpscIntQueue.java.
Where is size() defined?
size() is defined in common/src/main/java/io/netty/util/concurrent/MpscIntQueue.java at line 255.
What calls size()?
size() is called by 1 function(s): drain.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free