release: silence runtime logs and stabilize benches

- Fix HAKMEM_LOG gating to use  (numeric) so release builds compile out logs.
- Switch remaining prints to HAKMEM_LOG or guard with :
  - core/box/hak_core_init.inc.h (EVO sample warning, shutdown banner)
  - core/hakmem_config.c (config/feature prints)
  - core/hakmem.c (BigCache eviction prints)
  - core/hakmem_tiny_superslab.c (OOM, head init/expand, C7 init diagnostics)
  - core/hakmem_elo.c (init/evolution)
  - core/hakmem_batch.c (init/flush/stats)
  - core/hakmem_ace.c (33KB route diagnostics)
  - core/hakmem_ace_controller.c (ACE logs macro → no-op in release)
  - core/hakmem_site_rules.c (init banner)
  - core/box/hak_free_api.inc.h (unknown method error → release-gated)
- Rebuilt benches and verified quiet output for release:
  - bench_fixed_size_hakmem/system
  - bench_random_mixed_hakmem/system
  - bench_mid_large_mt_hakmem/system
  - bench_comprehensive_hakmem/system

Note: Kept debug logs available in debug builds and when explicitly toggled via env.
This commit is contained in:
Moe Charm (CI)
2025-11-11 01:47:06 +09:00
parent a97005f50e
commit 8feeb63c2b
25 changed files with 215 additions and 144 deletions

View File

@ -88,7 +88,7 @@ static void hak_init_impl(void) {
if (evo_sample_str && atoi(evo_sample_str) > 0) { if (evo_sample_str && atoi(evo_sample_str) > 0) {
int freq = atoi(evo_sample_str); int freq = atoi(evo_sample_str);
if (freq >= 64) { if (freq >= 64) {
fprintf(stderr, "[hakmem] Warning: HAKMEM_EVO_SAMPLE=%d too large, using 63\n", freq); HAKMEM_LOG("Warning: HAKMEM_EVO_SAMPLE=%d too large, using 63\n", freq);
freq = 63; freq = 63;
} }
g_evo_sample_mask = (1ULL << freq) - 1; g_evo_sample_mask = (1ULL << freq) - 1;
@ -313,7 +313,7 @@ void hak_shutdown(void) {
hkm_ace_controller_destroy(&g_ace_controller); hkm_ace_controller_destroy(&g_ace_controller);
if (!g_bench_tiny_only) { if (!g_bench_tiny_only) {
printf("[hakmem] Shutting down...\n"); HAKMEM_LOG("Shutting down...\n");
hak_print_stats(); hak_print_stats();
} }

View File

@ -255,7 +255,7 @@ void hak_free_at(void* ptr, size_t size, hak_callsite_t site) {
__libc_free(raw); __libc_free(raw);
#endif #endif
break; break;
default: fprintf(stderr, "[hakmem] ERROR: Unknown allocation method: %d\n", hdr->method); break; default: HAKMEM_LOG("ERROR: Unknown allocation method: %d\n", hdr->method); break;
} }
} }

View File

@ -139,24 +139,30 @@ void free(void* ptr) {
g_hakmem_lock_depth--; g_hakmem_lock_depth--;
return; return;
} }
// Front Gate libc bypass detection // Front Gate libc bypass detection (quiet in release)
static _Atomic uint64_t fg_libc_bypass_count = 0; static _Atomic uint64_t fg_libc_bypass_count = 0;
if (g_hakmem_lock_depth > 0) { if (g_hakmem_lock_depth > 0) {
#if !HAKMEM_BUILD_RELEASE
uint64_t count = atomic_fetch_add_explicit(&fg_libc_bypass_count, 1, memory_order_relaxed); uint64_t count = atomic_fetch_add_explicit(&fg_libc_bypass_count, 1, memory_order_relaxed);
if (count < 10) { // Log first 10 occurrences if (count < 10) {
fprintf(stderr, "[FG_LIBC_BYPASS] lockdepth=%d count=%llu ptr=%p\n", g_hakmem_lock_depth, (unsigned long long)count, ptr); fprintf(stderr, "[FG_LIBC_BYPASS] lockdepth=%d count=%llu ptr=%p\n", g_hakmem_lock_depth, (unsigned long long)count, ptr);
} }
#else
(void)fg_libc_bypass_count;
#endif
extern void __libc_free(void*); extern void __libc_free(void*);
ptr_trace_dump_now("wrap_libc_lockdepth"); ptr_trace_dump_now("wrap_libc_lockdepth");
__libc_free(ptr); __libc_free(ptr);
return; return;
} }
if (__builtin_expect(g_initializing != 0, 0)) { if (__builtin_expect(g_initializing != 0, 0)) {
#if !HAKMEM_BUILD_RELEASE
uint64_t count = atomic_fetch_add_explicit(&fg_libc_bypass_count, 1, memory_order_relaxed); uint64_t count = atomic_fetch_add_explicit(&fg_libc_bypass_count, 1, memory_order_relaxed);
if (count < 10) { // Log first 10 occurrences if (count < 10) {
fprintf(stderr, "[FG_LIBC_BYPASS] init=%d count=%llu ptr=%p\n", g_initializing, (unsigned long long)count, ptr); fprintf(stderr, "[FG_LIBC_BYPASS] init=%d count=%llu ptr=%p\n", g_initializing, (unsigned long long)count, ptr);
} }
#endif
extern void __libc_free(void*); extern void __libc_free(void*);
ptr_trace_dump_now("wrap_libc_init"); ptr_trace_dump_now("wrap_libc_init");
__libc_free(ptr); __libc_free(ptr);

View File

@ -5,52 +5,34 @@
void* hak_pool_try_alloc(size_t size, uintptr_t site_id) { void* hak_pool_try_alloc(size_t size, uintptr_t site_id) {
// Debug: IMMEDIATE output to verify function is called // Debug: IMMEDIATE output to verify function is called
static int first_call = 1; static int first_call = 1;
if (first_call) { if (first_call) { HAKMEM_LOG("[Pool] hak_pool_try_alloc FIRST CALL EVER!\n"); first_call = 0; }
fprintf(stderr, "[Pool] hak_pool_try_alloc FIRST CALL EVER!\n");
first_call = 0;
}
if (size == 40960) { // Exactly 40KB if (size == 40960) { HAKMEM_LOG("[Pool] hak_pool_try_alloc called with 40KB (Bridge class 5)\n"); }
fprintf(stderr, "[Pool] hak_pool_try_alloc called with 40KB (Bridge class 5)\n");
}
hak_pool_init(); // pthread_once() ensures thread-safe init (no data race!) hak_pool_init(); // pthread_once() ensures thread-safe init (no data race!)
// Debug for 33-41KB allocations // Debug for 33-41KB allocations
if (size >= 33000 && size <= 41000) { if (size >= 33000 && size <= 41000) { HAKMEM_LOG("[Pool] hak_pool_try_alloc: size=%zu (after init)\n", size); }
fprintf(stderr, "[Pool] hak_pool_try_alloc: size=%zu (after init)\n", size);
}
// P1.7 approach: Avoid using pool during ALL wrapper calls (conservative but safe) // P1.7 approach: Avoid using pool during ALL wrapper calls (conservative but safe)
extern int hak_in_wrapper(void); extern int hak_in_wrapper(void);
if (hak_in_wrapper() && !g_wrap_l2_enabled) { if (hak_in_wrapper() && !g_wrap_l2_enabled) {
if (size >= 33000 && size <= 41000) { if (size >= 33000 && size <= 41000) { HAKMEM_LOG("[Pool] REJECTED: in_wrapper=%d, wrap_l2=%d\n", hak_in_wrapper(), g_wrap_l2_enabled); }
fprintf(stderr, "[Pool] REJECTED: in_wrapper=%d, wrap_l2=%d\n",
hak_in_wrapper(), g_wrap_l2_enabled);
}
return NULL; return NULL;
} }
if (!hak_pool_is_poolable(size)) { if (!hak_pool_is_poolable(size)) {
if (size >= 33000 && size <= 41000) { if (size >= 33000 && size <= 41000) { HAKMEM_LOG("[Pool] REJECTED: not poolable (min=%d, max=%d)\n", POOL_MIN_SIZE, POOL_MAX_SIZE); }
fprintf(stderr, "[Pool] REJECTED: not poolable (min=%d, max=%d)\n",
POOL_MIN_SIZE, POOL_MAX_SIZE);
}
return NULL; return NULL;
} }
// Get class and shard indices // Get class and shard indices
int class_idx = hak_pool_get_class_index(size); int class_idx = hak_pool_get_class_index(size);
if (class_idx < 0) { if (class_idx < 0) {
if (size >= 33000 && size <= 41000) { if (size >= 33000 && size <= 41000) { HAKMEM_LOG("[Pool] REJECTED: class_idx=%d (size=%zu not mapped)\n", class_idx, size); }
fprintf(stderr, "[Pool] REJECTED: class_idx=%d (size=%zu not mapped)\n",
class_idx, size);
}
return NULL; return NULL;
} }
if (size >= 33000 && size <= 41000) { if (size >= 33000 && size <= 41000) { HAKMEM_LOG("[Pool] ACCEPTED: class_idx=%d, proceeding with allocation\n", class_idx); }
fprintf(stderr, "[Pool] ACCEPTED: class_idx=%d, proceeding with allocation\n", class_idx);
}
// MF2: Per-Page Sharding path // MF2: Per-Page Sharding path
if (g_mf2_enabled) { if (g_mf2_enabled) {

View File

@ -5,7 +5,7 @@
// Thread-safe initialization using pthread_once // Thread-safe initialization using pthread_once
static pthread_once_t hak_pool_init_once_control = PTHREAD_ONCE_INIT; static pthread_once_t hak_pool_init_once_control = PTHREAD_ONCE_INIT;
static void hak_pool_init_impl(void) { static void hak_pool_init_impl(void) {
fprintf(stderr, "[Pool] hak_pool_init_impl() EXECUTING - Bridge class fix applied\n"); HAKMEM_LOG("[Pool] hak_pool_init_impl() EXECUTING - Bridge class fix applied\n");
const FrozenPolicy* pol = hkm_policy_get(); const FrozenPolicy* pol = hkm_policy_get();
// Phase 6.21 CRITICAL FIX: Bridge classes are hardcoded in g_class_sizes, // Phase 6.21 CRITICAL FIX: Bridge classes are hardcoded in g_class_sizes,
@ -91,9 +91,9 @@ static void hak_pool_init_impl(void) {
HAKMEM_LOG("[MF2] max_queues=%d, lease_ms=%d, idle_threshold_us=%d\n", g_mf2_max_queues, g_mf2_lease_ms, g_mf2_idle_threshold_us); HAKMEM_LOG("[MF2] max_queues=%d, lease_ms=%d, idle_threshold_us=%d\n", g_mf2_max_queues, g_mf2_lease_ms, g_mf2_idle_threshold_us);
} }
g_pool.initialized = 1; g_pool.initialized = 1;
fprintf(stderr, "[Pool] Initialized (L2 Hybrid Pool) - Bridge classes SHOULD be enabled\n"); HAKMEM_LOG("[Pool] Initialized (L2 Hybrid Pool) - Bridge classes SHOULD be enabled\n");
fprintf(stderr, "[Pool] Class 5 (40KB): %zu\n", g_class_sizes[5]); HAKMEM_LOG("[Pool] Class 5 (40KB): %zu\n", g_class_sizes[5]);
fprintf(stderr, "[Pool] Class 6 (52KB): %zu\n", g_class_sizes[6]); HAKMEM_LOG("[Pool] Class 6 (52KB): %zu\n", g_class_sizes[6]);
HAKMEM_LOG("[Pool] Initialized (L2 Hybrid Pool)\n"); HAKMEM_LOG("[Pool] Initialized (L2 Hybrid Pool)\n");
#ifdef HAKMEM_DEBUG_VERBOSE #ifdef HAKMEM_DEBUG_VERBOSE
@ -123,10 +123,10 @@ static void hak_pool_init_impl(void) {
allocated++; allocated++;
} }
} }
fprintf(stderr, "[Pool] Pre-allocated %d pages for Bridge class 5 (%zu KB) - Critical for 33KB allocs\n", HAKMEM_LOG("[Pool] Pre-allocated %d pages for Bridge class 5 (%zu KB) - Critical for 33KB allocs\n",
allocated, g_class_sizes[5]/1024); allocated, g_class_sizes[5]/1024);
} else { } else {
fprintf(stderr, "[Pool] WARNING: Bridge class 5 (40KB) is DISABLED - 33KB allocations will fail!\n"); HAKMEM_LOG("[Pool] WARNING: Bridge class 5 (40KB) is DISABLED - 33KB allocations will fail!\n");
} }
// Pre-warm Bridge class 6 (52KB) // Pre-warm Bridge class 6 (52KB)
@ -137,17 +137,14 @@ static void hak_pool_init_impl(void) {
allocated++; allocated++;
} }
} }
fprintf(stderr, "[Pool] Pre-allocated %d pages for Bridge class 6 (%zu KB)\n", HAKMEM_LOG("[Pool] Pre-allocated %d pages for Bridge class 6 (%zu KB)\n",
allocated, g_class_sizes[6]/1024); allocated, g_class_sizes[6]/1024);
} }
} }
void hak_pool_init(void) { void hak_pool_init(void) {
// Always print this to see if it's being called // Debug-only trace
static int called = 0; // static int called = 0; if (called++ == 0) { HAKMEM_LOG("[Pool] hak_pool_init() called for the first time\n"); }
if (called++ == 0) {
fprintf(stderr, "[Pool] hak_pool_init() called for the first time\n");
}
pthread_once(&hak_pool_init_once_control, hak_pool_init_impl); pthread_once(&hak_pool_init_once_control, hak_pool_init_impl);
} }

View File

@ -263,7 +263,7 @@ static void bigcache_free_callback(void* ptr, size_t size) {
// Verify magic before accessing method field // Verify magic before accessing method field
if (hdr->magic != HAKMEM_MAGIC) { if (hdr->magic != HAKMEM_MAGIC) {
fprintf(stderr, "[hakmem] BigCache eviction: invalid magic, fallback to free()\n"); HAKMEM_LOG("BigCache eviction: invalid magic, fallback to free()\n");
// CRITICAL FIX: When magic is invalid, allocation came from LIBC (NO header) // CRITICAL FIX: When magic is invalid, allocation came from LIBC (NO header)
// Therefore ptr IS the allocated address, not raw (ptr - HEADER_SIZE) // Therefore ptr IS the allocated address, not raw (ptr - HEADER_SIZE)
// MUST use __libc_free to avoid infinite recursion through free() wrapper // MUST use __libc_free to avoid infinite recursion through free() wrapper
@ -302,7 +302,7 @@ static void bigcache_free_callback(void* ptr, size_t size) {
break; break;
default: default:
fprintf(stderr, "[hakmem] BigCache eviction: unknown method %d\n", hdr->method); HAKMEM_LOG("BigCache eviction: unknown method %d\n", hdr->method);
free(raw); // Fallback free(raw); // Fallback
break; break;
} }

View File

@ -1,4 +1,5 @@
#include <stdio.h> #include <stdio.h>
#include "hakmem_internal.h"
#include "hakmem_ace.h" #include "hakmem_ace.h"
#include "hakmem_pool.h" #include "hakmem_pool.h"
#include "hakmem_l25_pool.h" #include "hakmem_l25_pool.h"
@ -52,12 +53,16 @@ void* hkm_ace_alloc(size_t size, uintptr_t site_id, const FrozenPolicy* pol) {
// MidPool: 252KiB (Phase 6.21: with Bridge classes for W_MAX rounding) // MidPool: 252KiB (Phase 6.21: with Bridge classes for W_MAX rounding)
if (size >= 33000 && size <= 34000) { if (size >= 33000 && size <= 34000) {
#if !HAKMEM_BUILD_RELEASE
fprintf(stderr, "[ACE] Processing 33KB: size=%zu, POOL_MAX_SIZE=%d\n", size, POOL_MAX_SIZE); fprintf(stderr, "[ACE] Processing 33KB: size=%zu, POOL_MAX_SIZE=%d\n", size, POOL_MAX_SIZE);
#endif
} }
if (size <= POOL_MAX_SIZE) { if (size <= POOL_MAX_SIZE) {
size_t r = round_to_mid_class(size, wmax_mid, pol); size_t r = round_to_mid_class(size, wmax_mid, pol);
if (size >= 33000 && size <= 34000) { if (size >= 33000 && size <= 34000) {
#if !HAKMEM_BUILD_RELEASE
fprintf(stderr, "[ACE] round_to_mid_class returned: %zu (0 means no valid class)\n", r); fprintf(stderr, "[ACE] round_to_mid_class returned: %zu (0 means no valid class)\n", r);
#endif
} }
if (r != 0) { if (r != 0) {
// Debug: Log 33KB allocation routing (only in debug builds) // Debug: Log 33KB allocation routing (only in debug builds)
@ -67,7 +72,9 @@ void* hkm_ace_alloc(size_t size, uintptr_t site_id, const FrozenPolicy* pol) {
} }
#endif #endif
if (size >= 33000 && size <= 34000) { if (size >= 33000 && size <= 34000) {
#if !HAKMEM_BUILD_RELEASE
fprintf(stderr, "[ACE] Calling hak_pool_try_alloc with size=%zu\n", r); fprintf(stderr, "[ACE] Calling hak_pool_try_alloc with size=%zu\n", r);
#endif
} }
HKM_TIME_START(t_mid_get); HKM_TIME_START(t_mid_get);
void* p = hak_pool_try_alloc(r, site_id); void* p = hak_pool_try_alloc(r, site_id);

View File

@ -23,15 +23,23 @@ static uint64_t getenv_uint64(const char *name, uint64_t default_value) {
/* ========== ログマクロ ========== */ /* ========== ログマクロ ========== */
#if HAKMEM_BUILD_RELEASE
#define ACE_LOG_INFO(ctrl, fmt, ...) do { (void)(ctrl); } while (0)
#else
#define ACE_LOG_INFO(ctrl, fmt, ...) \ #define ACE_LOG_INFO(ctrl, fmt, ...) \
do { if (hkm_ace_log_info_enabled(ctrl)) { \ do { if (hkm_ace_log_info_enabled(ctrl)) { \
fprintf(stderr, "[ACE] " fmt "\n", ##__VA_ARGS__); \ fprintf(stderr, "[ACE] " fmt "\n", ##__VA_ARGS__); \
} } while (0) } } while (0)
#endif
#if HAKMEM_BUILD_RELEASE
#define ACE_LOG_DEBUG(ctrl, fmt, ...) do { (void)(ctrl); } while (0)
#else
#define ACE_LOG_DEBUG(ctrl, fmt, ...) \ #define ACE_LOG_DEBUG(ctrl, fmt, ...) \
do { if (hkm_ace_log_debug_enabled(ctrl)) { \ do { if (hkm_ace_log_debug_enabled(ctrl)) { \
fprintf(stderr, "[ACE DEBUG] " fmt "\n", ##__VA_ARGS__); \ fprintf(stderr, "[ACE DEBUG] " fmt "\n", ##__VA_ARGS__); \
} } while (0) } } while (0)
#endif
/* ========== 初期化 ========== */ /* ========== 初期化 ========== */

View File

@ -15,6 +15,8 @@
#include <stdlib.h> #include <stdlib.h>
#include <pthread.h> #include <pthread.h>
#include <stdatomic.h> #include <stdatomic.h>
// Release-silent logging
#include "hakmem_internal.h"
// For madvise (Linux) // For madvise (Linux)
#ifdef __linux__ #ifdef __linux__
@ -86,13 +88,10 @@ void hak_batch_init(void) {
} }
g_initialized = 1; g_initialized = 1;
{ #if !HAKMEM_BUILD_RELEASE
const char* q = getenv("HAKMEM_QUIET");
if (!(q && strcmp(q, "1") == 0)) {
fprintf(stderr, "[Batch] Initialized (threshold=%d MB, min_size=%d KB, bg=%s)\n", fprintf(stderr, "[Batch] Initialized (threshold=%d MB, min_size=%d KB, bg=%s)\n",
BATCH_THRESHOLD / (1024 * 1024), BATCH_MIN_SIZE / 1024, g_bg_enabled?"on":"off"); BATCH_THRESHOLD / (1024 * 1024), BATCH_MIN_SIZE / 1024, g_bg_enabled?"on":"off");
} #endif
}
} }
// Flush all batched blocks // Flush all batched blocks
@ -138,13 +137,10 @@ void hak_batch_flush(void) {
#endif #endif
g_flush_count++; g_flush_count++;
{ #if !HAKMEM_BUILD_RELEASE
const char* q = getenv("HAKMEM_QUIET");
if (!(q && strcmp(q, "1") == 0)) {
fprintf(stderr, "[Batch] Flushed %d blocks (%.1f MB) - flush #%lu\n", fprintf(stderr, "[Batch] Flushed %d blocks (%.1f MB) - flush #%lu\n",
snap.count, snap.total_bytes / (1024.0 * 1024.0), g_flush_count); snap.count, snap.total_bytes / (1024.0 * 1024.0), g_flush_count);
} #endif
}
} }
// Add block to batch // Add block to batch
@ -203,10 +199,7 @@ void hak_batch_shutdown(void) {
} else { } else {
// Flush any remaining blocks synchronously // Flush any remaining blocks synchronously
if (g_batch.count > 0) { if (g_batch.count > 0) {
const char* q = getenv("HAKMEM_QUIET");
if (!(q && strcmp(q, "1") == 0)) {
fprintf(stderr, "[Batch] Final flush of %d remaining blocks...\n", g_batch.count); fprintf(stderr, "[Batch] Final flush of %d remaining blocks...\n", g_batch.count);
}
hak_batch_flush(); hak_batch_flush();
} }
} }
@ -219,6 +212,7 @@ void hak_batch_shutdown(void) {
void hak_batch_print_stats(void) { void hak_batch_print_stats(void) {
if (!g_initialized) return; if (!g_initialized) return;
#if !HAKMEM_BUILD_RELEASE
fprintf(stderr, "\n========================================\n"); fprintf(stderr, "\n========================================\n");
fprintf(stderr, "madvise Batching Statistics\n"); fprintf(stderr, "madvise Batching Statistics\n");
fprintf(stderr, "========================================\n"); fprintf(stderr, "========================================\n");
@ -236,6 +230,7 @@ void hak_batch_print_stats(void) {
fprintf(stderr, "Pending blocks: %d\n", g_batch.count); fprintf(stderr, "Pending blocks: %d\n", g_batch.count);
fprintf(stderr, "Pending bytes: %.1f MB\n", g_batch.total_bytes / (1024.0 * 1024.0)); fprintf(stderr, "Pending bytes: %.1f MB\n", g_batch.total_bytes / (1024.0 * 1024.0));
fprintf(stderr, "========================================\n\n"); fprintf(stderr, "========================================\n\n");
#endif
} }
// Query pending bytes // Query pending bytes

View File

@ -4,6 +4,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "hakmem_internal.h" // HAKMEM_LOG for release-silent logging
// =========================================================================== // ===========================================================================
// Global Configuration Instance // Global Configuration Instance
@ -158,7 +159,7 @@ void hak_config_apply_mode(HakemMode mode) {
case HAKMEM_MODE_LEARNING: apply_learning_mode(&g_hakem_config); break; case HAKMEM_MODE_LEARNING: apply_learning_mode(&g_hakem_config); break;
case HAKMEM_MODE_RESEARCH: apply_research_mode(&g_hakem_config); break; case HAKMEM_MODE_RESEARCH: apply_research_mode(&g_hakem_config); break;
default: default:
fprintf(stderr, "[hakmem] Unknown mode %d, using BALANCED\n", mode); HAKMEM_LOG("Unknown mode %d, using BALANCED\n", mode);
apply_balanced_mode(&g_hakem_config); apply_balanced_mode(&g_hakem_config);
break; break;
} }
@ -177,7 +178,7 @@ static HakemMode parse_mode_env(const char* mode_str) {
if (strcmp(mode_str, "learning") == 0) return HAKMEM_MODE_LEARNING; if (strcmp(mode_str, "learning") == 0) return HAKMEM_MODE_LEARNING;
if (strcmp(mode_str, "research") == 0) return HAKMEM_MODE_RESEARCH; if (strcmp(mode_str, "research") == 0) return HAKMEM_MODE_RESEARCH;
fprintf(stderr, "[hakmem] Unknown HAKMEM_MODE='%s', using balanced\n", mode_str); HAKMEM_LOG("Unknown HAKMEM_MODE='%s', using balanced\n", mode_str);
return HAKMEM_MODE_BALANCED; return HAKMEM_MODE_BALANCED;
} }
@ -247,58 +248,58 @@ void hak_config_init(void) {
// =========================================================================== // ===========================================================================
void hak_config_print(void) { void hak_config_print(void) {
fprintf(stderr, "\n========================================\n"); HAKMEM_LOG("\n========================================\n");
fprintf(stderr, "hakmem Configuration\n"); HAKMEM_LOG("hakmem Configuration\n");
fprintf(stderr, "========================================\n"); HAKMEM_LOG("========================================\n");
fprintf(stderr, "Mode: %s\n", g_hakem_config.mode_name); HAKMEM_LOG("Mode: %s\n", g_hakem_config.mode_name);
fprintf(stderr, "\n"); HAKMEM_LOG("\n");
fprintf(stderr, "Features:\n"); HAKMEM_LOG("Features:\n");
fprintf(stderr, " Allocation:\n"); HAKMEM_LOG(" Allocation:\n");
fprintf(stderr, " malloc: %s\n", (g_hakem_config.features.alloc & HAKMEM_FEATURE_MALLOC) ? "ON" : "OFF"); HAKMEM_LOG(" malloc: %s\n", (g_hakem_config.features.alloc & HAKMEM_FEATURE_MALLOC) ? "ON" : "OFF");
fprintf(stderr, " mmap: %s\n", (g_hakem_config.features.alloc & HAKMEM_FEATURE_MMAP) ? "ON" : "OFF"); HAKMEM_LOG(" mmap: %s\n", (g_hakem_config.features.alloc & HAKMEM_FEATURE_MMAP) ? "ON" : "OFF");
fprintf(stderr, " pool: %s\n", (g_hakem_config.features.alloc & HAKMEM_FEATURE_POOL) ? "ON" : "OFF"); HAKMEM_LOG(" pool: %s\n", (g_hakem_config.features.alloc & HAKMEM_FEATURE_POOL) ? "ON" : "OFF");
fprintf(stderr, " Caching:\n"); HAKMEM_LOG(" Caching:\n");
fprintf(stderr, " BigCache: %s\n", (g_hakem_config.features.cache & HAKMEM_FEATURE_BIGCACHE) ? "ON" : "OFF"); HAKMEM_LOG(" BigCache: %s\n", (g_hakem_config.features.cache & HAKMEM_FEATURE_BIGCACHE) ? "ON" : "OFF");
fprintf(stderr, " TinyPool: %s\n", (g_hakem_config.features.cache & HAKMEM_FEATURE_TINYPOOL) ? "ON" : "OFF"); HAKMEM_LOG(" TinyPool: %s\n", (g_hakem_config.features.cache & HAKMEM_FEATURE_TINYPOOL) ? "ON" : "OFF");
fprintf(stderr, " Learning:\n"); HAKMEM_LOG(" Learning:\n");
fprintf(stderr, " ELO: %s\n", (g_hakem_config.features.learning & HAKMEM_FEATURE_ELO) ? "ON" : "OFF"); HAKMEM_LOG(" ELO: %s\n", (g_hakem_config.features.learning & HAKMEM_FEATURE_ELO) ? "ON" : "OFF");
fprintf(stderr, " Evolution: %s\n", (g_hakem_config.features.learning & HAKMEM_FEATURE_EVOLUTION) ? "ON" : "OFF"); HAKMEM_LOG(" Evolution: %s\n", (g_hakem_config.features.learning & HAKMEM_FEATURE_EVOLUTION) ? "ON" : "OFF");
fprintf(stderr, " Profiling: %s\n", (g_hakem_config.features.learning & HAKMEM_FEATURE_PROFILING) ? "ON" : "OFF"); HAKMEM_LOG(" Profiling: %s\n", (g_hakem_config.features.learning & HAKMEM_FEATURE_PROFILING) ? "ON" : "OFF");
fprintf(stderr, " Memory:\n"); HAKMEM_LOG(" Memory:\n");
fprintf(stderr, " Batch madvise: %s\n", (g_hakem_config.features.memory & HAKMEM_FEATURE_BATCH_MADVISE) ? "ON" : "OFF"); HAKMEM_LOG(" Batch madvise: %s\n", (g_hakem_config.features.memory & HAKMEM_FEATURE_BATCH_MADVISE) ? "ON" : "OFF");
fprintf(stderr, " THP: %s\n", (g_hakem_config.features.memory & HAKMEM_FEATURE_THP) ? "ON" : "OFF"); HAKMEM_LOG(" THP: %s\n", (g_hakem_config.features.memory & HAKMEM_FEATURE_THP) ? "ON" : "OFF");
fprintf(stderr, " Free policy: %s\n", (g_hakem_config.features.memory & HAKMEM_FEATURE_FREE_POLICY) ? "ON" : "OFF"); HAKMEM_LOG(" Free policy: %s\n", (g_hakem_config.features.memory & HAKMEM_FEATURE_FREE_POLICY) ? "ON" : "OFF");
fprintf(stderr, " Debug:\n"); HAKMEM_LOG(" Debug:\n");
fprintf(stderr, " Logging: %s\n", (g_hakem_config.features.debug & HAKMEM_FEATURE_DEBUG_LOG) ? "ON" : "OFF"); HAKMEM_LOG(" Logging: %s\n", (g_hakem_config.features.debug & HAKMEM_FEATURE_DEBUG_LOG) ? "ON" : "OFF");
fprintf(stderr, " Statistics: %s\n", (g_hakem_config.features.debug & HAKMEM_FEATURE_STATISTICS) ? "ON" : "OFF"); HAKMEM_LOG(" Statistics: %s\n", (g_hakem_config.features.debug & HAKMEM_FEATURE_STATISTICS) ? "ON" : "OFF");
fprintf(stderr, " Trace: %s\n", (g_hakem_config.features.debug & HAKMEM_FEATURE_TRACE) ? "ON" : "OFF"); HAKMEM_LOG(" Trace: %s\n", (g_hakem_config.features.debug & HAKMEM_FEATURE_TRACE) ? "ON" : "OFF");
fprintf(stderr, "\n"); HAKMEM_LOG("\n");
fprintf(stderr, "Policies:\n"); HAKMEM_LOG("Policies:\n");
fprintf(stderr, " Free policy: %s\n", HAKMEM_LOG(" Free policy: %s\n",
g_hakem_config.free_policy == FREE_POLICY_BATCH ? "batch" : g_hakem_config.free_policy == FREE_POLICY_BATCH ? "batch" :
g_hakem_config.free_policy == FREE_POLICY_KEEP ? "keep" : g_hakem_config.free_policy == FREE_POLICY_KEEP ? "keep" :
g_hakem_config.free_policy == FREE_POLICY_ADAPTIVE ? "adaptive" : "unknown"); g_hakem_config.free_policy == FREE_POLICY_ADAPTIVE ? "adaptive" : "unknown");
fprintf(stderr, " THP policy: %s\n", HAKMEM_LOG(" THP policy: %s\n",
g_hakem_config.thp_policy == THP_POLICY_OFF ? "off" : g_hakem_config.thp_policy == THP_POLICY_OFF ? "off" :
g_hakem_config.thp_policy == THP_POLICY_AUTO ? "auto" : g_hakem_config.thp_policy == THP_POLICY_AUTO ? "auto" :
g_hakem_config.thp_policy == THP_POLICY_ON ? "on" : "unknown"); g_hakem_config.thp_policy == THP_POLICY_ON ? "on" : "unknown");
fprintf(stderr, " Evo phase: %s\n", HAKMEM_LOG(" Evo phase: %s\n",
g_hakem_config.evo_phase == EVO_PHASE_LEARN ? "learn" : g_hakem_config.evo_phase == EVO_PHASE_LEARN ? "learn" :
g_hakem_config.evo_phase == EVO_PHASE_FROZEN ? "frozen" : g_hakem_config.evo_phase == EVO_PHASE_FROZEN ? "frozen" :
g_hakem_config.evo_phase == EVO_PHASE_CANARY ? "canary" : "unknown"); g_hakem_config.evo_phase == EVO_PHASE_CANARY ? "canary" : "unknown");
fprintf(stderr, "\n"); HAKMEM_LOG("\n");
fprintf(stderr, "Parameters:\n"); HAKMEM_LOG("Parameters:\n");
fprintf(stderr, " ELO frozen strategy: %d\n", g_hakem_config.elo_frozen_strategy); HAKMEM_LOG(" ELO frozen strategy: %d\n", g_hakem_config.elo_frozen_strategy);
fprintf(stderr, " Batch threshold: %zu bytes\n", g_hakem_config.batch_threshold); HAKMEM_LOG(" Batch threshold: %zu bytes\n", g_hakem_config.batch_threshold);
fprintf(stderr, " Verbose level: %d\n", g_hakem_config.verbose); HAKMEM_LOG(" Verbose level: %d\n", g_hakem_config.verbose);
fprintf(stderr, "========================================\n\n"); HAKMEM_LOG("========================================\n\n");
} }
// =========================================================================== // ===========================================================================
@ -323,12 +324,12 @@ HakemFeatureSet hak_features_for_mode(const char* mode_str) {
} }
void hak_features_print(HakemFeatureSet* fs) { void hak_features_print(HakemFeatureSet* fs) {
fprintf(stderr, "Feature Set:\n"); HAKMEM_LOG("Feature Set:\n");
fprintf(stderr, " alloc: 0x%08x\n", fs->alloc); HAKMEM_LOG(" alloc: 0x%08x\n", fs->alloc);
fprintf(stderr, " cache: 0x%08x\n", fs->cache); HAKMEM_LOG(" cache: 0x%08x\n", fs->cache);
fprintf(stderr, " learning: 0x%08x\n", fs->learning); HAKMEM_LOG(" learning: 0x%08x\n", fs->learning);
fprintf(stderr, " memory: 0x%08x\n", fs->memory); HAKMEM_LOG(" memory: 0x%08x\n", fs->memory);
fprintf(stderr, " debug: 0x%08x\n", fs->debug); HAKMEM_LOG(" debug: 0x%08x\n", fs->debug);
} }
// Box Refactor line default: enable SuperSlab unless explicitly disabled by env or diet mode // Box Refactor line default: enable SuperSlab unless explicitly disabled by env or diet mode
int g_use_superslab = 1; int g_use_superslab = 1;

View File

@ -71,10 +71,9 @@ void hak_elo_init(void) {
g_current_strategy = g_num_strategies / 2; g_current_strategy = g_num_strategies / 2;
g_initialized = 1; g_initialized = 1;
const char* q = getenv("HAKMEM_QUIET"); #if !HAKMEM_BUILD_RELEASE
if (!(q && strcmp(q, "1") == 0)) {
fprintf(stderr, "[ELO] Initialized %d strategies (thresholds: 512KB-32MB)\n", g_num_strategies); fprintf(stderr, "[ELO] Initialized %d strategies (thresholds: 512KB-32MB)\n", g_num_strategies);
} #endif
} }
// Shutdown ELO system // Shutdown ELO system
@ -189,7 +188,9 @@ void hak_elo_update_ratings(EloStrategyCandidate* a, EloStrategyCandidate* b, do
void hak_elo_trigger_evolution(void) { void hak_elo_trigger_evolution(void) {
if (!g_initialized) return; if (!g_initialized) return;
{ const char* q = getenv("HAKMEM_QUIET"); if (!(q && strcmp(q, "1") == 0)) fprintf(stderr, "[ELO] Triggering evolution (pairwise comparison)...\n"); } #if !HAKMEM_BUILD_RELEASE
fprintf(stderr, "[ELO] Triggering evolution (pairwise comparison)...\n");
#endif
// Count active strategies with enough samples // Count active strategies with enough samples
int eligible[ELO_MAX_STRATEGIES]; int eligible[ELO_MAX_STRATEGIES];
@ -308,3 +309,5 @@ void hak_elo_print_leaderboard(void) {
s->active ? "ACTIVE" : "eliminated"); } s->active ? "ACTIVE" : "eliminated"); }
} }
} }
// Release-silent logging
#include "hakmem_internal.h"

View File

@ -38,7 +38,7 @@ extern int g_ldpreload_mode;
// Debug: make debug → Logs enabled (unless HAKMEM_QUIET=1) // Debug: make debug → Logs enabled (unless HAKMEM_QUIET=1)
// Debug quiet: HAKMEM_QUIET=1 ... → Logs suppressed at runtime // Debug quiet: HAKMEM_QUIET=1 ... → Logs suppressed at runtime
#ifdef HAKMEM_DEBUG_VERBOSE #if HAKMEM_DEBUG_VERBOSE
// Debug build: Check HAKMEM_QUIET at runtime // Debug build: Check HAKMEM_QUIET at runtime
#define HAKMEM_LOG(fmt, ...) do { \ #define HAKMEM_LOG(fmt, ...) do { \
static int quiet_checked = 0; \ static int quiet_checked = 0; \

View File

@ -9,6 +9,7 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <time.h> #include <time.h>
#include "hakmem_internal.h"
// =========================================================================== // ===========================================================================
// Internal Data Structures // Internal Data Structures
@ -88,7 +89,9 @@ void hak_site_rules_init(void) {
memset(&g_site_rules, 0, sizeof(g_site_rules)); memset(&g_site_rules, 0, sizeof(g_site_rules));
g_site_rules.initialized = 1; g_site_rules.initialized = 1;
printf("[SiteRules] Initialized (MVP: 4-probe hash, capacity=%d)\n", SITE_RULES_CAPACITY); #if !HAKMEM_BUILD_RELEASE
fprintf(stderr, "[SiteRules] Initialized (MVP: 4-probe hash, capacity=%d)\n", SITE_RULES_CAPACITY);
#endif
} }
void hak_site_rules_shutdown(void) { void hak_site_rules_shutdown(void) {

View File

@ -23,7 +23,7 @@ int hak_is_initializing(void);
#define TINY_NUM_CLASSES 8 #define TINY_NUM_CLASSES 8
#define TINY_SLAB_SIZE (64 * 1024) // 64KB per slab #define TINY_SLAB_SIZE (64 * 1024) // 64KB per slab
#define TINY_MAX_SIZE 1536 // Maximum allocation size (1.5KB, accommodate 1024B + header) #define TINY_MAX_SIZE 1024 // Tiny handles up to 1024B (C7 headerless)
// ============================================================================ // ============================================================================
// Size Classes // Size Classes
@ -236,18 +236,17 @@ void hkm_ace_set_drain_threshold(int class_idx, uint32_t threshold);
// Convert size to class index (branchless lookup) // Convert size to class index (branchless lookup)
// Quick Win #4: 2-3 cycles (table lookup) vs 5 cycles (branch chain) // Quick Win #4: 2-3 cycles (table lookup) vs 5 cycles (branch chain)
static inline int hak_tiny_size_to_class(size_t size) { static inline int hak_tiny_size_to_class(size_t size) {
if (size == 0 || size > TINY_MAX_SIZE) return -1; if (size == 0) return -1;
#if HAKMEM_TINY_HEADER_CLASSIDX #if HAKMEM_TINY_HEADER_CLASSIDX
// Phase 7 header adds +1 byte. Special-case 1024B to remain in Tiny (no header). // C7: 1024B is headerless and maps directly to class 7
// Rationale: Avoid forcing 1024B to Mid/OS which causes frequent mmap/madvise. if (size == 1024) return g_size_to_class_lut_1k[1024];
if (size == TINY_MAX_SIZE) { // Other sizes must fit with +1 header within 1..1024 range
return g_size_to_class_lut_1k[size]; // class 7 (1024B blocks) size_t alloc_size = size + 1; // header byte
} if (alloc_size < 1 || alloc_size > 1024) return -1;
size_t alloc_size = size + 1; // Add header for other sizes
if (alloc_size > TINY_MAX_SIZE) return -1;
return g_size_to_class_lut_1k[alloc_size]; return g_size_to_class_lut_1k[alloc_size];
#else #else
return g_size_to_class_lut_1k[size]; // 1..1024: single load if (size > 1024) return -1;
return g_size_to_class_lut_1k[size]; // 1..1024
#endif #endif
} }

View File

@ -300,6 +300,7 @@ static inline int sll_refill_batch_from_ss(int class_idx, int max_take) {
: tiny_slab_base_for(tls->ss, tls->slab_idx); : tiny_slab_base_for(tls->ss, tls->slab_idx);
// Diagnostic log (one-shot) // Diagnostic log (one-shot)
#if !HAKMEM_BUILD_RELEASE
static _Atomic int g_carve_log_printed = 0; static _Atomic int g_carve_log_printed = 0;
if (atomic_load(&g_carve_log_printed) == 0 && if (atomic_load(&g_carve_log_printed) == 0 &&
atomic_exchange(&g_carve_log_printed, 1) == 0) { atomic_exchange(&g_carve_log_printed, 1) == 0) {
@ -308,6 +309,7 @@ static inline int sll_refill_batch_from_ss(int class_idx, int max_take) {
(void*)slab_base, bs); (void*)slab_base, bs);
fflush(stderr); fflush(stderr);
} }
#endif
TinyRefillChain carve; TinyRefillChain carve;
trc_linear_carve(slab_base, bs, meta, batch, class_idx, &carve); trc_linear_carve(slab_base, bs, meta, batch, class_idx, &carve);

View File

@ -16,6 +16,7 @@
#include <unistd.h> #include <unistd.h>
#include <sys/resource.h> // getrlimit for OOM diagnostics #include <sys/resource.h> // getrlimit for OOM diagnostics
#include <sys/mman.h> #include <sys/mman.h>
#include "hakmem_internal.h" // HAKMEM_LOG for release-silent logging
static int g_ss_force_lg = -1; static int g_ss_force_lg = -1;
static _Atomic int g_ss_populate_once = 0; static _Atomic int g_ss_populate_once = 0;
@ -166,6 +167,7 @@ static void log_superslab_oom_once(size_t ss_size, size_t alloc_size, int err) {
snprintf(rl_max_buf, sizeof(rl_max_buf), "%llu", (unsigned long long)rl.rlim_max); snprintf(rl_max_buf, sizeof(rl_max_buf), "%llu", (unsigned long long)rl.rlim_max);
} }
#if !HAKMEM_BUILD_RELEASE
fprintf(stderr, fprintf(stderr,
"[SS OOM] mmap failed: err=%d ss_size=%zu alloc_size=%zu " "[SS OOM] mmap failed: err=%d ss_size=%zu alloc_size=%zu "
"alloc=%llu freed=%llu bytes=%llu " "alloc=%llu freed=%llu bytes=%llu "
@ -180,6 +182,7 @@ static void log_superslab_oom_once(size_t ss_size, size_t alloc_size, int err) {
rl_max_buf, rl_max_buf,
vm_size_kb, vm_size_kb,
vm_rss_kb); vm_rss_kb);
#endif
g_hakmem_lock_depth--; // Now safe to restore (all libc calls complete) g_hakmem_lock_depth--; // Now safe to restore (all libc calls complete)
} }
@ -229,11 +232,13 @@ static void* ss_os_acquire(uint8_t size_class, size_t ss_size, uintptr_t ss_mask
-1, 0); -1, 0);
if (raw != MAP_FAILED) { if (raw != MAP_FAILED) {
uint64_t count = atomic_fetch_add(&g_ss_mmap_count, 1) + 1; uint64_t count = atomic_fetch_add(&g_ss_mmap_count, 1) + 1;
#if !HAKMEM_BUILD_RELEASE
if (log_count < 10) { if (log_count < 10) {
fprintf(stderr, "[SUPERSLAB_MMAP] #%lu: class=%d size=%zu (total SuperSlab mmaps so far)\n", fprintf(stderr, "[SUPERSLAB_MMAP] #%lu: class=%d size=%zu (total SuperSlab mmaps so far)\n",
(unsigned long)count, size_class, ss_size); (unsigned long)count, size_class, ss_size);
log_count++; log_count++;
} }
#endif
} }
if (raw == MAP_FAILED) { if (raw == MAP_FAILED) {
log_superslab_oom_once(ss_size, alloc_size, errno); log_superslab_oom_once(ss_size, alloc_size, errno);
@ -562,8 +567,10 @@ SuperSlabHead* init_superslab_head(int class_idx) {
extern __thread int g_hakmem_lock_depth; extern __thread int g_hakmem_lock_depth;
g_hakmem_lock_depth++; g_hakmem_lock_depth++;
#if !HAKMEM_BUILD_RELEASE
fprintf(stderr, "[HAKMEM] Initialized SuperSlabHead for class %d: %zu initial chunks\n", fprintf(stderr, "[HAKMEM] Initialized SuperSlabHead for class %d: %zu initial chunks\n",
class_idx, atomic_load_explicit(&head->total_chunks, memory_order_relaxed)); class_idx, atomic_load_explicit(&head->total_chunks, memory_order_relaxed));
#endif
g_hakmem_lock_depth--; g_hakmem_lock_depth--;
return head; return head;
@ -745,13 +752,14 @@ void superslab_init_slab(SuperSlab* ss, int slab_idx, size_t block_size, uint32_
static _Atomic int g_cap_log_printed = 0; static _Atomic int g_cap_log_printed = 0;
if (atomic_load(&g_cap_log_printed) == 0 && if (atomic_load(&g_cap_log_printed) == 0 &&
atomic_exchange(&g_cap_log_printed, 1) == 0) { atomic_exchange(&g_cap_log_printed, 1) == 0) {
#if !HAKMEM_BUILD_RELEASE
fprintf(stderr, "[SUPERSLAB_INIT] class 7 slab 0: usable_size=%zu stride=%zu capacity=%d\n", fprintf(stderr, "[SUPERSLAB_INIT] class 7 slab 0: usable_size=%zu stride=%zu capacity=%d\n",
usable_size, stride, capacity); usable_size, stride, capacity);
fprintf(stderr, "[SUPERSLAB_INIT] Expected: 63488 / 1024 = 62 blocks\n"); fprintf(stderr, "[SUPERSLAB_INIT] Expected: 63488 / 1024 = 62 blocks\n");
if (capacity != 62) { if (capacity != 62) {
fprintf(stderr, "[SUPERSLAB_INIT] WARNING: capacity=%d (expected 62!)\n", capacity); fprintf(stderr, "[SUPERSLAB_INIT] WARNING: capacity=%d (expected 62!)\n", capacity);
} }
fflush(stderr); #endif
} }
} }

View File

@ -1,5 +1,6 @@
#include <stddef.h> #include <stddef.h>
#include <stdlib.h> #include <stdlib.h>
#include <sys/types.h>
// Weak, no-op stubs to satisfy link in configurations where // Weak, no-op stubs to satisfy link in configurations where
// optional components are compiled out or gated by flags. // optional components are compiled out or gated by flags.
@ -25,3 +26,11 @@ __attribute__((weak)) void pool_free(void* ptr) {
// Fallback to free if Pool TLS not linked // Fallback to free if Pool TLS not linked
free(ptr); free(ptr);
} }
// Pool TLS registry lookup stub (used by Front Gate classifier when POOL_TLS is enabled)
__attribute__((weak)) int pool_reg_lookup(void* ptr, pid_t* tid_out, int* class_idx_out) {
(void)ptr; if (tid_out) *tid_out = 0; if (class_idx_out) *class_idx_out = -1; return 0; // not found
}
// Memory profile print stub (bench_comprehensive references this symbol)
__attribute__((weak)) void hak_tiny_print_memory_profile(void) {}

View File

@ -102,10 +102,12 @@ static inline int trc_refill_guard_enabled(void) {
// Debug: Default ON, but allow explicit disable // Debug: Default ON, but allow explicit disable
g_trc_guard = (env && *env) ? ((*env != '0') ? 1 : 0) : 1; g_trc_guard = (env && *env) ? ((*env != '0') ? 1 : 0) : 1;
#endif #endif
#if !HAKMEM_BUILD_RELEASE
fprintf(stderr, "[TRC_GUARD] failfast=%d env=%s mode=%s\n", fprintf(stderr, "[TRC_GUARD] failfast=%d env=%s mode=%s\n",
g_trc_guard, env ? env : "(null)", g_trc_guard, env ? env : "(null)",
HAKMEM_BUILD_RELEASE ? "release" : "debug"); HAKMEM_BUILD_RELEASE ? "release" : "debug");
fflush(stderr); fflush(stderr);
#endif
} }
return g_trc_guard; return g_trc_guard;
} }

View File

@ -32,7 +32,9 @@ static inline void hak_tiny_free_superslab(void* ptr, SuperSlab* ss) {
static _Atomic int c7_free_count = 0; static _Atomic int c7_free_count = 0;
int count = atomic_fetch_add_explicit(&c7_free_count, 1, memory_order_relaxed); int count = atomic_fetch_add_explicit(&c7_free_count, 1, memory_order_relaxed);
if (count == 0) { if (count == 0) {
#if !HAKMEM_BUILD_RELEASE
fprintf(stderr, "[C7_FIRST_FREE] ptr=%p base=%p slab_idx=%d\n", ptr, base, slab_idx); fprintf(stderr, "[C7_FIRST_FREE] ptr=%p base=%p slab_idx=%d\n", ptr, base, slab_idx);
#endif
} }
} }
if (__builtin_expect(tiny_remote_watch_is(ptr), 0)) { if (__builtin_expect(tiny_remote_watch_is(ptr), 0)) {

View File

@ -1,6 +1,15 @@
hakmem_ace.o: core/hakmem_ace.c core/hakmem_ace.h core/hakmem_policy.h \ hakmem_ace.o: core/hakmem_ace.c core/hakmem_internal.h core/hakmem.h \
core/hakmem_pool.h core/hakmem_l25_pool.h core/hakmem_ace_stats.h \ core/hakmem_build_flags.h core/hakmem_config.h core/hakmem_features.h \
core/hakmem_debug.h core/hakmem_sys.h core/hakmem_whale.h core/hakmem_ace.h \
core/hakmem_policy.h core/hakmem_pool.h core/hakmem_l25_pool.h \
core/hakmem_ace_stats.h core/hakmem_debug.h
core/hakmem_internal.h:
core/hakmem.h:
core/hakmem_build_flags.h:
core/hakmem_config.h:
core/hakmem_features.h:
core/hakmem_sys.h:
core/hakmem_whale.h:
core/hakmem_ace.h: core/hakmem_ace.h:
core/hakmem_policy.h: core/hakmem_policy.h:
core/hakmem_pool.h: core/hakmem_pool.h:

View File

@ -1,5 +1,11 @@
hakmem_batch.o: core/hakmem_batch.c core/hakmem_batch.h core/hakmem_sys.h \ hakmem_batch.o: core/hakmem_batch.c core/hakmem_batch.h core/hakmem_sys.h \
core/hakmem_whale.h core/hakmem_whale.h core/hakmem_internal.h core/hakmem.h \
core/hakmem_build_flags.h core/hakmem_config.h core/hakmem_features.h
core/hakmem_batch.h: core/hakmem_batch.h:
core/hakmem_sys.h: core/hakmem_sys.h:
core/hakmem_whale.h: core/hakmem_whale.h:
core/hakmem_internal.h:
core/hakmem.h:
core/hakmem_build_flags.h:
core/hakmem_config.h:
core/hakmem_features.h:

View File

@ -1,4 +1,10 @@
hakmem_config.o: core/hakmem_config.c core/hakmem_config.h \ hakmem_config.o: core/hakmem_config.c core/hakmem_config.h \
core/hakmem_features.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_config.h: core/hakmem_config.h:
core/hakmem_features.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:

View File

@ -1,2 +1,11 @@
hakmem_elo.o: core/hakmem_elo.c core/hakmem_elo.h hakmem_elo.o: core/hakmem_elo.c core/hakmem_elo.h core/hakmem_internal.h \
core/hakmem.h core/hakmem_build_flags.h core/hakmem_config.h \
core/hakmem_features.h core/hakmem_sys.h core/hakmem_whale.h
core/hakmem_elo.h: core/hakmem_elo.h:
core/hakmem_internal.h:
core/hakmem.h:
core/hakmem_build_flags.h:
core/hakmem_config.h:
core/hakmem_features.h:
core/hakmem_sys.h:
core/hakmem_whale.h:

View File

@ -1,4 +1,13 @@
hakmem_site_rules.o: core/hakmem_site_rules.c core/hakmem_site_rules.h \ hakmem_site_rules.o: core/hakmem_site_rules.c core/hakmem_site_rules.h \
core/hakmem_pool.h core/hakmem_pool.h core/hakmem_internal.h core/hakmem.h \
core/hakmem_build_flags.h core/hakmem_config.h core/hakmem_features.h \
core/hakmem_sys.h core/hakmem_whale.h
core/hakmem_site_rules.h: core/hakmem_site_rules.h:
core/hakmem_pool.h: core/hakmem_pool.h:
core/hakmem_internal.h:
core/hakmem.h:
core/hakmem_build_flags.h:
core/hakmem_config.h:
core/hakmem_features.h:
core/hakmem_sys.h:
core/hakmem_whale.h:

View File

@ -7,7 +7,9 @@ hakmem_tiny_superslab.o: core/hakmem_tiny_superslab.c \
core/superslab/../hakmem_tiny_config.h core/tiny_debug_ring.h \ core/superslab/../hakmem_tiny_config.h core/tiny_debug_ring.h \
core/tiny_remote.h core/hakmem_tiny_superslab_constants.h \ core/tiny_remote.h core/hakmem_tiny_superslab_constants.h \
core/hakmem_build_flags.h core/hakmem_super_registry.h \ core/hakmem_build_flags.h core/hakmem_super_registry.h \
core/hakmem_tiny.h core/hakmem_trace.h core/hakmem_tiny_mini_mag.h core/hakmem_tiny.h core/hakmem_trace.h core/hakmem_tiny_mini_mag.h \
core/hakmem_internal.h core/hakmem.h core/hakmem_config.h \
core/hakmem_features.h core/hakmem_sys.h core/hakmem_whale.h
core/hakmem_tiny_superslab.h: core/hakmem_tiny_superslab.h:
core/superslab/superslab_types.h: core/superslab/superslab_types.h:
core/hakmem_tiny_superslab_constants.h: core/hakmem_tiny_superslab_constants.h:
@ -26,3 +28,9 @@ core/hakmem_super_registry.h:
core/hakmem_tiny.h: core/hakmem_tiny.h:
core/hakmem_trace.h: core/hakmem_trace.h:
core/hakmem_tiny_mini_mag.h: core/hakmem_tiny_mini_mag.h:
core/hakmem_internal.h:
core/hakmem.h:
core/hakmem_config.h:
core/hakmem_features.h:
core/hakmem_sys.h:
core/hakmem_whale.h: