diff --git a/core/hakmem_super_registry.c b/core/hakmem_super_registry.c index c25240e1..3557ae18 100644 --- a/core/hakmem_super_registry.c +++ b/core/hakmem_super_registry.c @@ -276,12 +276,16 @@ void hak_ss_lru_touch(SuperSlab* ss) { // Evict one SuperSlab from tail (oldest) // Returns: 1 if evicted, 0 if cache is empty static int ss_lru_evict_one(void) { +#if !HAKMEM_BUILD_RELEASE // Debug logging flag (lazy init) static int dbg = -1; if (__builtin_expect(dbg == -1, 0)) { const char* e = getenv("HAKMEM_SS_LRU_DEBUG"); dbg = (e && *e && *e != '0') ? 1 : 0; } +#else + static const int dbg = 0; +#endif SuperSlab* victim = g_ss_lru_cache.lru_tail; if (!victim) return 0; @@ -368,12 +372,16 @@ SuperSlab* hak_ss_lru_pop(uint8_t size_class) { return NULL; } +#if !HAKMEM_BUILD_RELEASE // Debug logging flag (lazy init) static __thread int dbg = -1; if (__builtin_expect(dbg == -1, 0)) { const char* e = getenv("HAKMEM_SS_LRU_DEBUG"); dbg = (e && *e && *e != '0') ? 1 : 0; } +#else + static const int dbg = 0; +#endif pthread_mutex_lock(&g_super_reg_lock); @@ -486,12 +494,16 @@ int hak_ss_lru_push(SuperSlab* ss) { hak_ss_lru_init(); } +#if !HAKMEM_BUILD_RELEASE // Debug logging flag (lazy init) static __thread int dbg = -1; if (__builtin_expect(dbg == -1, 0)) { const char* e = getenv("HAKMEM_SS_LRU_DEBUG"); dbg = (e && *e && *e != '0') ? 1 : 0; } +#else + static const int dbg = 0; +#endif pthread_mutex_lock(&g_super_reg_lock);