diff --git a/core/hakmem_debug.c b/core/hakmem_debug.c index 3a2c0965..7e077171 100644 --- a/core/hakmem_debug.c +++ b/core/hakmem_debug.c @@ -149,11 +149,15 @@ static void atexit_handler(void) { void hkm_timing_init(void) { if (g_initialized) return; - // Check HAKMEM_TIMING environment variable +#if !HAKMEM_BUILD_RELEASE + // Check HAKMEM_TIMING environment variable (gated behind !HAKMEM_BUILD_RELEASE) const char* env = getenv("HAKMEM_TIMING"); if (env && strcmp(env, "1") == 0) { g_timing_enabled = 1; } +#else + g_timing_enabled = 0; // Always disabled in release builds +#endif // Initialize global stats memset(g_global_stats, 0, sizeof(g_global_stats));