24 lines
927 B
C
24 lines
927 B
C
|
|
// 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
|