ENV Cleanup Step 4: Gate HAKMEM_WATCH_ADDR in tiny_region_id.h
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 <noreply@anthropic.com>
This commit is contained in:
@ -56,6 +56,7 @@ static inline uint32_t watcher_self_u32(void) {
|
|||||||
// Address watcher: Tracks when a specific address is allocated or freed
|
// Address watcher: Tracks when a specific address is allocated or freed
|
||||||
// Usage: HAKMEM_WATCH_ADDR=0x7f1234567890 ./program
|
// Usage: HAKMEM_WATCH_ADDR=0x7f1234567890 ./program
|
||||||
static inline uintptr_t get_watch_addr(void) {
|
static inline uintptr_t get_watch_addr(void) {
|
||||||
|
#if !HAKMEM_BUILD_RELEASE
|
||||||
static uintptr_t watch_addr = 0;
|
static uintptr_t watch_addr = 0;
|
||||||
static int initialized = 0;
|
static int initialized = 0;
|
||||||
|
|
||||||
@ -77,6 +78,9 @@ static inline uintptr_t get_watch_addr(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return watch_addr;
|
return watch_addr;
|
||||||
|
#else
|
||||||
|
return 0;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// Allocation source tracking
|
// Allocation source tracking
|
||||||
|
|||||||
Reference in New Issue
Block a user