Merge separate g_tls_sll_head[] and g_tls_sll_count[] arrays into unified TinyTLSSLL struct to improve L1D cache locality. Expected performance gain: +12-18% from reducing cache line splits (2 loads → 1 load per operation). Changes: - core/hakmem_tiny.h: Add TinyTLSSLL type (16B aligned, head+count+pad) - core/hakmem_tiny.c: Replace separate arrays with g_tls_sll[8] - core/box/tls_sll_box.h: Update Box API (13 sites) for unified access - Updated 32+ files: All g_tls_sll_head[i] → g_tls_sll[i].head - Updated 32+ files: All g_tls_sll_count[i] → g_tls_sll[i].count - core/hakmem_tiny_integrity.h: Unified canary guards - core/box/integrity_box.c: Simplified canary validation - Makefile: Added core/box/tiny_sizeclass_hist_box.o to link Build: ✅ PASS (10K ops sanity test) Warnings: Only pre-existing LTO type mismatches (unrelated) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
30 lines
911 B
C
30 lines
911 B
C
// Box: Unified Backend (Phase 12)
|
|
// Purpose: Unified entry point for SuperSlab allocation (shared pool + legacy fallback)
|
|
//
|
|
// Responsibilities:
|
|
// - Single front-door for tiny-side SuperSlab allocations
|
|
// - Shared pool backend integration
|
|
// - Optional legacy fallback for compatibility
|
|
// - ENV-based policy control (HAKMEM_TINY_SS_SHARED, etc.)
|
|
//
|
|
// Dependencies:
|
|
// - ss_legacy_backend_box (legacy backend)
|
|
// - hakmem_shared_pool (shared pool backend)
|
|
//
|
|
// API:
|
|
// - hak_tiny_alloc_superslab_box() - unified entry point
|
|
// - hak_tiny_alloc_superslab_backend_shared() - shared pool backend
|
|
|
|
#ifndef SS_UNIFIED_BACKEND_BOX_H
|
|
#define SS_UNIFIED_BACKEND_BOX_H
|
|
|
|
#include <stddef.h>
|
|
|
|
// Unified entry point (Box API)
|
|
void* hak_tiny_alloc_superslab_box(int class_idx);
|
|
|
|
// Shared pool backend
|
|
void* hak_tiny_alloc_superslab_backend_shared(int class_idx);
|
|
|
|
#endif // SS_UNIFIED_BACKEND_BOX_H
|