Files
hakmem/core/box/ss_tls_hint_box.c.old

24 lines
927 B
C
Raw Normal View History

// ss_tls_hint_box.c - Phase 9-1-4: TLS Hints Implementation
// Purpose: Thread-local storage for SuperSlab lookup cache
#include "ss_tls_hint_box.h"
#include "../hakmem_tiny_superslab.h"
// ============================================================================
// TLS Variables
// ============================================================================
// TLS cache: Most recently used SuperSlab per size class
// - Each thread gets its own cache (no synchronization needed)
// - Initialized to NULL on first access
__thread struct SuperSlab* g_tls_ss_hint[TINY_NUM_CLASSES] = {NULL};
// ============================================================================
// Statistics (Debug builds only)
// ============================================================================
#if !HAKMEM_BUILD_RELEASE
// Per-thread statistics for TLS hint performance
__thread SSTLSHintStats g_tls_hint_stats = {0};
#endif