Box TLS-SLL: fix splice head normalization and remove false misalignment guard; add header-aware linear link instrumentation; log splice details in debug.\n\n- Normalize head before publishing to TLS SLL (avoid user-ptr head)\n- Remove size-mod alignment guard (stride!=size); keep small-ptr fail-fast only\n- Drop heuristic base normalization to avoid corrupting base\n- Add [LINEAR_LINK]/[SPLICE_LINK]/[SPLICE_SET_HEAD] debug logs (debug-only)\n- Verified debug build on bench_fixed_size_hakmem with visible carve/splice traces

This commit is contained in:
Moe Charm (CI)
2025-11-11 00:02:24 +09:00
parent 518bf29754
commit 8aabee4392
15 changed files with 860 additions and 31 deletions

View File

@ -743,6 +743,20 @@ static inline void* hak_tiny_alloc_superslab(int class_idx) {
// }
meta->used++;
// Debug: Log first C7 alloc for path verification
if (class_idx == 7) {
static _Atomic int c7_alloc_count = 0;
int count = atomic_fetch_add_explicit(&c7_alloc_count, 1, memory_order_relaxed);
if (count == 0) {
void* next = NULL;
// C7 has no header, next pointer is at base
if (block && ss->size_class == 7) {
next = *(void**)block;
}
fprintf(stderr, "[C7_FIRST_ALLOC] ptr=%p next=%p slab_idx=%d\n", block, next, slab_idx);
}
}
// Track active blocks in SuperSlab for conservative reclamation
ss_active_inc(ss);
HAK_RET_ALLOC(class_idx, block); // Phase 8.4: Zero hot-path overhead