allocate() — netty Function Reference
Architecture documentation for the allocate() function in PoolSubpage.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD a871ec93_3c33_5694_cdf3_d9e756a2556c["allocate()"] a6a571ea_fcf9_6eda_c073_f8d61fa999a3["PoolSubpage"] a871ec93_3c33_5694_cdf3_d9e756a2556c -->|defined in| a6a571ea_fcf9_6eda_c073_f8d61fa999a3 c43f611b_3492_7c52_e24a_c4a5fff99a83["getNextAvail()"] a871ec93_3c33_5694_cdf3_d9e756a2556c -->|calls| c43f611b_3492_7c52_e24a_c4a5fff99a83 ece8cfac_ec12_b1cc_40c7_2768a79012a6["removeFromPool()"] a871ec93_3c33_5694_cdf3_d9e756a2556c -->|calls| ece8cfac_ec12_b1cc_40c7_2768a79012a6 d5c6d0c4_a94d_8d37_d027_53b9442f2238["toHandle()"] a871ec93_3c33_5694_cdf3_d9e756a2556c -->|calls| d5c6d0c4_a94d_8d37_d027_53b9442f2238 style a871ec93_3c33_5694_cdf3_d9e756a2556c fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
buffer/src/main/java/io/netty/buffer/PoolSubpage.java lines 90–112
long allocate() {
if (numAvail == 0 || !doNotDestroy) {
return -1;
}
final int bitmapIdx = getNextAvail();
if (bitmapIdx < 0) {
removeFromPool(); // Subpage appear to be in an invalid state. Remove to prevent repeated errors.
throw new AssertionError("No next available bitmap index found (bitmapIdx = " + bitmapIdx + "), " +
"even though there are supposed to be (numAvail = " + numAvail + ") " +
"out of (maxNumElems = " + maxNumElems + ") available indexes.");
}
int q = bitmapIdx >>> 6;
int r = bitmapIdx & 63;
assert (bitmap[q] >>> r & 1) == 0;
bitmap[q] |= 1L << r;
if (-- numAvail == 0) {
removeFromPool();
}
return toHandle(bitmapIdx);
}
Domain
Subdomains
Source
Frequently Asked Questions
What does allocate() do?
allocate() is a function in the netty codebase, defined in buffer/src/main/java/io/netty/buffer/PoolSubpage.java.
Where is allocate() defined?
allocate() is defined in buffer/src/main/java/io/netty/buffer/PoolSubpage.java at line 90.
What does allocate() call?
allocate() calls 3 function(s): getNextAvail, removeFromPool, toHandle.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free