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

Function mem_phase_enabled

src/foundation/mem.c:707–719  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

705}
706
707static bool mem_phase_enabled(void) {
708 int state = atomic_load_explicit(&g_mem_phase_enabled, memory_order_acquire);
709 if (state >= 0) {
710 return state == 1;
711 }
712 char buf[CBM_SZ_16];
713 bool on = cbm_safe_getenv("CBM_MEM_PHASES", buf, sizeof(buf), NULL) != NULL && buf[0] == '1';
714 if (on) {
715 cbm_mutex_init(&g_mem_phase_mutex);
716 }
717 atomic_store_explicit(&g_mem_phase_enabled, on ? 1 : 0, memory_order_release);
718 return on;
719}
720
721void cbm_mem_phase_mark(const char *label) {
722 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