From 3833d4e3ebfe539ddbc4ceac4aa69437d77e8a04 Mon Sep 17 00:00:00 2001 From: "Moe Charm (CI)" Date: Fri, 28 Nov 2025 00:43:07 +0900 Subject: [PATCH] ENV Cleanup Step 1: Gate tiny_debug.h with HAKMEM_BUILD_RELEASE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Wrap debug functionality in !HAKMEM_BUILD_RELEASE guard with no-op stubs for release builds. This eliminates getenv() calls for HAKMEM_TINY_ALLOC_DEBUG in production while maintaining API compatibility. Performance: 30.0M ops/s (baseline: 30.2M) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- core/tiny_debug.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/core/tiny_debug.h b/core/tiny_debug.h index eff84f61..727e58ba 100644 --- a/core/tiny_debug.h +++ b/core/tiny_debug.h @@ -1,6 +1,8 @@ #ifndef TINY_DEBUG_H #define TINY_DEBUG_H +#if !HAKMEM_BUILD_RELEASE + #include #include #include @@ -49,4 +51,20 @@ static inline void tiny_alloc_dump_tls_state(int class_idx, const char* tag, Tin } } +#else // HAKMEM_BUILD_RELEASE + +// No-op stubs for release builds +static inline int tiny_alloc_debug_enabled(void) { + return 0; +} + +static inline void tiny_alloc_dump_tls_state(int class_idx, const char* tag, TinyTLSSlab* tls) { + (void)class_idx; + (void)tag; + (void)tls; + // No-op in release builds +} + +#endif // !HAKMEM_BUILD_RELEASE + #endif // TINY_DEBUG_H