- Root cause: header-based class indexing (HEADER_CLASSIDX=1) wrote a 1-byte header during allocation, but linear carve/refill and initial slab capacity still used bare class block sizes. This mismatch could overrun slab usable space and corrupt freelists, causing reproducible SEGV at ~100k iters. Changes - Superslab: compute capacity with effective stride (block_size + header for classes 0..6; class7 remains headerless) in superslab_init_slab(). Add a debug-only bound check in superslab_alloc_from_slab() to fail fast if carve would exceed usable bytes. - Refill (non-P0 and P0): use header-aware stride for all linear carving and TLS window bump operations. Ensure alignment/validation in tiny_refill_opt.h also uses stride, not raw class size. - Drain: keep existing defense-in-depth for remote sentinel and sanitize nodes before splicing into freelist (already present). Notes - This unifies the memory layout across alloc/linear-carve/refill with a single stride definition and keeps class7 (1024B) headerless as designed. - Debug builds add fail-fast checks; release builds remain lean. Next - Re-run Tiny benches (256/1024B) in debug to confirm stability, then in release. If any remaining crash persists, bisect with HAKMEM_TINY_P0_BATCH_REFILL=0 to isolate P0 batch carve, and continue reducing branch-miss as planned.
34 lines
1.2 KiB
Makefile
34 lines
1.2 KiB
Makefile
hakmem_pool.o: core/hakmem_pool.c core/hakmem_pool.h core/hakmem_config.h \
|
|
core/hakmem_features.h core/hakmem_internal.h core/hakmem.h \
|
|
core/hakmem_build_flags.h core/hakmem_sys.h core/hakmem_whale.h \
|
|
core/hakmem_syscall.h core/hakmem_prof.h core/hakmem_policy.h \
|
|
core/hakmem_debug.h core/box/pool_tls_types.inc.h \
|
|
core/box/pool_mid_desc.inc.h core/box/pool_mid_tc.inc.h \
|
|
core/box/pool_mf2_types.inc.h core/box/pool_mf2_helpers.inc.h \
|
|
core/box/pool_mf2_adoption.inc.h core/box/pool_tls_core.inc.h \
|
|
core/box/pool_refill.inc.h core/box/pool_init_api.inc.h \
|
|
core/box/pool_stats.inc.h core/box/pool_api.inc.h
|
|
core/hakmem_pool.h:
|
|
core/hakmem_config.h:
|
|
core/hakmem_features.h:
|
|
core/hakmem_internal.h:
|
|
core/hakmem.h:
|
|
core/hakmem_build_flags.h:
|
|
core/hakmem_sys.h:
|
|
core/hakmem_whale.h:
|
|
core/hakmem_syscall.h:
|
|
core/hakmem_prof.h:
|
|
core/hakmem_policy.h:
|
|
core/hakmem_debug.h:
|
|
core/box/pool_tls_types.inc.h:
|
|
core/box/pool_mid_desc.inc.h:
|
|
core/box/pool_mid_tc.inc.h:
|
|
core/box/pool_mf2_types.inc.h:
|
|
core/box/pool_mf2_helpers.inc.h:
|
|
core/box/pool_mf2_adoption.inc.h:
|
|
core/box/pool_tls_core.inc.h:
|
|
core/box/pool_refill.inc.h:
|
|
core/box/pool_init_api.inc.h:
|
|
core/box/pool_stats.inc.h:
|
|
core/box/pool_api.inc.h:
|