MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / diag_stats_write

Function diag_stats_write

src/foundation/diagnostics.c:136–141  ·  view source on GitHub ↗

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. */

Source from the content-addressed store, hash-verified

134 * live" (a real leak) — opposite conclusions that process-level RSS and
135 * committed bytes cannot tell apart. Off unless CBM_MEM_STATS=1. */
136static 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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected