free() — netty Function Reference
Architecture documentation for the free() function in PoolThreadCache.java from the netty codebase.
Entity Profile
Dependency Diagram
graph TD 67fe01c2_aedc_a81c_c637_b03b96610998["free()"] f4c407ea_9e8c_d00d_ea7e_e355c94f8aba["PoolThreadCache"] 67fe01c2_aedc_a81c_c637_b03b96610998 -->|defined in| f4c407ea_9e8c_d00d_ea7e_e355c94f8aba 81ffb468_a88d_4b96_03a3_87154836c556["free()"] 81ffb468_a88d_4b96_03a3_87154836c556 -->|calls| 67fe01c2_aedc_a81c_c637_b03b96610998 562c77b5_107e_e3e8_4481_0717613d42f3["trim()"] 562c77b5_107e_e3e8_4481_0717613d42f3 -->|calls| 67fe01c2_aedc_a81c_c637_b03b96610998 6a490f6b_0a0e_531d_db52_9bb29522c8ab["finalize()"] 6a490f6b_0a0e_531d_db52_9bb29522c8ab -->|calls| 67fe01c2_aedc_a81c_c637_b03b96610998 81ffb468_a88d_4b96_03a3_87154836c556["free()"] 67fe01c2_aedc_a81c_c637_b03b96610998 -->|calls| 81ffb468_a88d_4b96_03a3_87154836c556 style 67fe01c2_aedc_a81c_c637_b03b96610998 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
buffer/src/main/java/io/netty/buffer/PoolThreadCache.java lines 203–229
void free(boolean finalizer) {
// As free() may be called either by the finalizer or by FastThreadLocal.onRemoval(...) we need to ensure
// we only call this one time.
if (freed.compareAndSet(false, true)) {
if (freeOnFinalize != null) {
// Help GC: this can race with a finalizer thread, but will be null out regardless
freeOnFinalize.cache = null;
}
int numFreed = free(smallSubPageDirectCaches, finalizer) +
free(normalDirectCaches, finalizer) +
free(smallSubPageHeapCaches, finalizer) +
free(normalHeapCaches, finalizer);
if (numFreed > 0 && logger.isDebugEnabled()) {
logger.debug("Freed {} thread-local buffer(s) from thread: {}", numFreed,
Thread.currentThread().getName());
}
if (directArena != null) {
directArena.numThreadCaches.getAndDecrement();
}
if (heapArena != null) {
heapArena.numThreadCaches.getAndDecrement();
}
}
}
Domain
Subdomains
Calls
Called By
Source
Frequently Asked Questions
What does free() do?
free() is a function in the netty codebase, defined in buffer/src/main/java/io/netty/buffer/PoolThreadCache.java.
Where is free() defined?
free() is defined in buffer/src/main/java/io/netty/buffer/PoolThreadCache.java at line 203.
What does free() call?
free() calls 1 function(s): free.
What calls free()?
free() is called by 3 function(s): finalize, free, trim.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free