From 316ea4dfd6dc2cc7e95a559cc60890a09fc427a5 Mon Sep 17 00:00:00 2001 From: "Moe Charm (CI)" Date: Fri, 28 Nov 2025 00:47:16 +0900 Subject: [PATCH] ENV Cleanup Step 4: Gate HAKMEM_WATCH_ADDR in tiny_region_id.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Gate get_watch_addr() debug functionality with HAKMEM_BUILD_RELEASE, returning 0 in release builds to disable address watching overhead. Performance: 30.31M ops/s (baseline: 30.2M) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- core/tiny_region_id.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/tiny_region_id.h b/core/tiny_region_id.h index cdcd21d2..444275ec 100644 --- a/core/tiny_region_id.h +++ b/core/tiny_region_id.h @@ -56,6 +56,7 @@ static inline uint32_t watcher_self_u32(void) { // Address watcher: Tracks when a specific address is allocated or freed // Usage: HAKMEM_WATCH_ADDR=0x7f1234567890 ./program static inline uintptr_t get_watch_addr(void) { +#if !HAKMEM_BUILD_RELEASE static uintptr_t watch_addr = 0; static int initialized = 0; @@ -77,6 +78,9 @@ static inline uintptr_t get_watch_addr(void) { } return watch_addr; +#else + return 0; +#endif } // Allocation source tracking