ENV Cleanup Step 6: Gate HAKMEM_TIMING in core/hakmem_debug.c

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 <noreply@anthropic.com>
This commit is contained in:
Moe Charm (CI)
2025-11-28 01:05:18 +09:00
parent 35e8e4c34d
commit d0d2814f15

View File

@ -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));