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:
@ -50,10 +50,7 @@ extern __thread uint32_t g_tls_sll_count[TINY_NUM_CLASSES];
|
||||
(ptr_out) = NULL; \
|
||||
} else { \
|
||||
/* Phase 7: header-aware next (C0-C6: base+1, C7: base) */ \
|
||||
size_t _off = 0; \
|
||||
#if HAKMEM_TINY_HEADER_CLASSIDX \
|
||||
_off = ((class_idx) == 7) ? 0 : 1; \
|
||||
#endif \
|
||||
size_t _off = (HAKMEM_TINY_HEADER_CLASSIDX ? (((class_idx) == 7) ? 0 : 1) : 0); \
|
||||
void* _next = *(void**)((uint8_t*)_head + _off); \
|
||||
g_tls_sll_head[(class_idx)] = _next; \
|
||||
if (g_tls_sll_count[(class_idx)] > 0) { \
|
||||
@ -87,10 +84,7 @@ extern __thread uint32_t g_tls_sll_count[TINY_NUM_CLASSES];
|
||||
//
|
||||
#define TINY_ALLOC_FAST_PUSH_INLINE(class_idx, ptr) do { \
|
||||
/* Phase 7: header-aware next (C0-C6: base+1, C7: base) */ \
|
||||
size_t _off = 0; \
|
||||
#if HAKMEM_TINY_HEADER_CLASSIDX \
|
||||
_off = ((class_idx) == 7) ? 0 : 1; \
|
||||
#endif \
|
||||
size_t _off = (HAKMEM_TINY_HEADER_CLASSIDX ? (((class_idx) == 7) ? 0 : 1) : 0); \
|
||||
*(void**)((uint8_t*)(ptr) + _off) = g_tls_sll_head[(class_idx)]; \
|
||||
g_tls_sll_head[(class_idx)] = (ptr); \
|
||||
g_tls_sll_count[(class_idx)]++; \
|
||||
|
||||
Reference in New Issue
Block a user