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

Function mem_phase_enabled

src/foundation/mem.c:912–924  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

910}
911
912static bool mem_phase_enabled(void) {
913 int state = atomic_load_explicit(&g_mem_phase_enabled, memory_order_acquire);
914 if (state >= 0) {
915 return state == 1;
916 }
917 char buf[CBM_SZ_16];
918 bool on = cbm_safe_getenv("CBM_MEM_PHASES", buf, sizeof(buf), NULL) != NULL && buf[0] == '1';
919 if (on) {
920 cbm_mutex_init(&g_mem_phase_mutex);
921 }
922 atomic_store_explicit(&g_mem_phase_enabled, on ? 1 : 0, memory_order_release);
923 return on;
924}
925
926bool cbm_mem_phases_enabled(void) {
927 return mem_phase_enabled();

Callers 4

cbm_mem_phases_enabledFunction · 0.85
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