Capture the allocator's OWN accounting alongside the snapshot. This is the * only measurement that separates "the allocator holds committed-but-free * pages" (fragmentation / slice granularity) from "these blocks are still * live" (a real leak) — opposite conclusions that process-level RSS and * committed bytes cannot tell apart. Off unless CBM_MEM_STATS=1. */
| 134 | * live" (a real leak) — opposite conclusions that process-level RSS and |
| 135 | * committed bytes cannot tell apart. Off unless CBM_MEM_STATS=1. */ |
| 136 | static void diag_stats_write(const char *text, void *arg) { |
| 137 | FILE *sink = arg; |
| 138 | if (sink && text) { |
| 139 | (void)fputs(text, sink); |
| 140 | } |
| 141 | } |
| 142 | |
| 143 | /* Create the stats file at its fixed, discoverable path without ever writing |
| 144 | * through something another process planted there. Exclusive creation IS the |
nothing calls this directly
no outgoing calls
no test coverage detected