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

Function mem_phase_enabled

src/foundation/mem.c:678–690  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

676}
677
678static bool mem_phase_enabled(void) {
679 int state = atomic_load_explicit(&g_mem_phase_enabled, memory_order_acquire);
680 if (state >= 0) {
681 return state == 1;
682 }
683 char buf[CBM_SZ_16];
684 bool on = cbm_safe_getenv("CBM_MEM_PHASES", buf, sizeof(buf), NULL) != NULL && buf[0] == '1';
685 if (on) {
686 cbm_mutex_init(&g_mem_phase_mutex);
687 }
688 atomic_store_explicit(&g_mem_phase_enabled, on ? 1 : 0, memory_order_release);
689 return on;
690}
691
692void cbm_mem_phase_mark(const char *label) {
693 if (!mem_phase_enabled()) {

Callers 3

cbm_mem_phase_markFunction · 0.85
cbm_mem_phase_resetFunction · 0.85

Calls 2

cbm_safe_getenvFunction · 0.85
cbm_mutex_initFunction · 0.85

Tested by

no test coverage detected