ENV Cleanup Step 2a: Gate debug code in hakmem_tiny_slow.inc
Gate tiny_alloc_dump_tls_state() call and getenv debug code on slow path failure with HAKMEM_BUILD_RELEASE guard. Performance: 30.5M 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:
@ -75,6 +75,7 @@ static void* __attribute__((cold, noinline)) hak_tiny_alloc_slow(size_t size, in
|
||||
HAK_RET_ALLOC(class_idx, ss_ptr);
|
||||
}
|
||||
|
||||
#if !HAKMEM_BUILD_RELEASE
|
||||
tiny_alloc_dump_tls_state(class_idx, "slow_fail", &g_tls_slabs[class_idx]);
|
||||
// Optional one-shot debug when final slow path fails
|
||||
static int g_alloc_dbg = -1; if (__builtin_expect(g_alloc_dbg == -1, 0)) { const char* e=getenv("HAKMEM_TINY_ALLOC_DEBUG"); g_alloc_dbg = (e && atoi(e)!=0)?1:0; }
|
||||
@ -84,6 +85,7 @@ static void* __attribute__((cold, noinline)) hak_tiny_alloc_slow(size_t size, in
|
||||
fprintf(stderr, "[ALLOC-SLOW] hak_tiny_alloc_superslab returned NULL class=%d size=%zu\n", class_idx, size);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return ss_ptr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user