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:
@ -149,11 +149,15 @@ static void atexit_handler(void) {
|
|||||||
void hkm_timing_init(void) {
|
void hkm_timing_init(void) {
|
||||||
if (g_initialized) return;
|
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");
|
const char* env = getenv("HAKMEM_TIMING");
|
||||||
if (env && strcmp(env, "1") == 0) {
|
if (env && strcmp(env, "1") == 0) {
|
||||||
g_timing_enabled = 1;
|
g_timing_enabled = 1;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
g_timing_enabled = 0; // Always disabled in release builds
|
||||||
|
#endif
|
||||||
|
|
||||||
// Initialize global stats
|
// Initialize global stats
|
||||||
memset(g_global_stats, 0, sizeof(g_global_stats));
|
memset(g_global_stats, 0, sizeof(g_global_stats));
|
||||||
|
|||||||
Reference in New Issue
Block a user