1. Archive unused backend files (ss_legacy/unified_backend_box.c/h) - These files were not linked in the build - Moved to archive/ to reduce confusion 2. Created HAK_RET_ALLOC_BLOCK macro for SuperSlab allocations - Replaces superslab_return_block() function - Consistent with existing HAK_RET_ALLOC pattern - Single source of truth for header writing - Defined in hakmem_tiny_superslab_internal.h 3. Added header validation on TLS SLL push - Detects blocks pushed without proper header - Enabled via HAKMEM_TINY_SLL_VALIDATE_HDR=1 (release) - Always on in debug builds - Logs first 10 violations with backtraces Benefits: - Easier to track allocation paths - Catches header bugs at push time - More maintainable macro-based design Note: Larson bug still reproduces - header corruption occurs before push validation can catch it. 🤖 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
|