- 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.
37 lines
1.5 KiB
C
37 lines
1.5 KiB
C
#include <stddef.h>
|
|
#include <stdlib.h>
|
|
#include <sys/types.h>
|
|
|
|
// Weak, no-op stubs to satisfy link in configurations where
|
|
// optional components are compiled out or gated by flags.
|
|
// Real implementations (when present) will override these.
|
|
|
|
__attribute__((weak)) void hak_tiny_prewarm_tls_cache(void) {}
|
|
|
|
// Weak stubs for remote tracking (avoid LTO link errors when tiny_remote.c is GC'ed)
|
|
struct SuperSlab; // forward decl to avoid heavy includes
|
|
__attribute__((weak)) void tiny_remote_track_on_local_free(struct SuperSlab* ss, int slab_idx, void* node, const char* stage, unsigned int tid) {
|
|
(void)ss; (void)slab_idx; (void)node; (void)stage; (void)tid;
|
|
}
|
|
__attribute__((weak)) void tiny_remote_track_expect_alloc(struct SuperSlab* ss, int slab_idx, void* node, const char* stage, unsigned int tid) {
|
|
(void)ss; (void)slab_idx; (void)node; (void)stage; (void)tid;
|
|
}
|
|
|
|
__attribute__((weak)) void* pool_alloc(size_t size) {
|
|
// Fallback to malloc if Pool TLS not linked
|
|
return malloc(size);
|
|
}
|
|
|
|
__attribute__((weak)) void pool_free(void* ptr) {
|
|
// Fallback to free if Pool TLS not linked
|
|
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) {}
|