From d0d2814f1524715301e5e2d77216aab78b9ad394 Mon Sep 17 00:00:00 2001 From: "Moe Charm (CI)" Date: Fri, 28 Nov 2025 01:05:18 +0900 Subject: [PATCH] ENV Cleanup Step 6: Gate HAKMEM_TIMING in core/hakmem_debug.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changes: - Gated HAKMEM_TIMING ENV check behind #if !HAKMEM_BUILD_RELEASE - Release builds set g_timing_enabled = 0 directly (no getenv call) - Debug builds preserve existing behavior - ENV variable gated: HAKMEM_TIMING Performance: 30.3M ops/s Larson (baseline 30.4M, within margin) Build: Clean, LTO warnings only (pre-existing) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- core/hakmem_debug.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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));