Fix release build debug logging in tiny_region_id.h
The allocation logging at line 236-249 was missing the #if !HAKMEM_BUILD_RELEASE guard, causing fprintf(stderr) on every allocation even in release builds. Impact: 19.8M ops/s → 28.0M ops/s (+42%) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@ -234,8 +234,7 @@ static inline void* tiny_region_id_write_header(void* base, int class_idx) {
|
||||
PTR_TRACK_MALLOC(base, 0, class_idx); // Track at BASE (where header is)
|
||||
|
||||
// ========== ALLOCATION LOGGING (Debug builds only) ==========
|
||||
// NOTE: This logging is ALWAYS active (not guarded by HAKMEM_BUILD_RELEASE)
|
||||
// because we need to track allocations even in optimized debug builds
|
||||
#if !HAKMEM_BUILD_RELEASE
|
||||
{
|
||||
extern _Atomic uint64_t g_debug_op_count;
|
||||
extern __thread TinyTLSSLL g_tls_sll[];
|
||||
@ -247,6 +246,7 @@ static inline void* tiny_region_id_write_header(void* base, int class_idx) {
|
||||
fflush(stderr);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
// ========== END ALLOCATION LOGGING ==========
|
||||
|
||||
// Optional guard: log stride/base/user for targeted class
|
||||
|
||||
Reference in New Issue
Block a user