Working state before pushing to cyu remote

This commit is contained in:
Moe Charm (CI)
2025-12-19 03:45:01 +09:00
parent e4c5f05355
commit 2013514f7b
28 changed files with 1968 additions and 43 deletions

View File

@ -25,6 +25,9 @@
#include "tiny_inline_slots_fixed_mode_box.h" // Phase 78-1: Optional fixed-mode gating
#include "tiny_inline_slots_switch_dispatch_box.h" // Phase 80-1: Switch dispatch for C4/C5/C6
#include "tiny_inline_slots_switch_dispatch_fixed_box.h" // Phase 83-1: Switch dispatch fixed mode
#include "tiny_inline_slots_overflow_stats_box.h" // Phase 87b: Legacy fallback counter
#include "tiny_c6_inline_slots_ifl_env_box.h" // Phase 91: C6 intrusive LIFO inline slots ENV gate
#include "tiny_c6_inline_slots_ifl_tls_box.h" // Phase 91: C6 intrusive LIFO inline slots TLS state
// Purpose: Encapsulate legacy free logic (shared by multiple paths)
// Called by: malloc_tiny_fast.h (free path) + tiny_c6_ultra_free_box.c (C6 fallback)
@ -36,6 +39,9 @@
//
__attribute__((always_inline))
static inline void tiny_legacy_fallback_free_base_with_env(void* base, uint32_t class_idx, const HakmemEnvSnapshot* env) {
// Phase 87b: Count legacy fallback calls for verification
atomic_fetch_add(&g_inline_slots_overflow_stats.legacy_fallback_calls, 1);
// Phase 80-1: Switch dispatch for C4/C5/C6 (branch reduction optimization)
// Phase 83-1: Per-op branch removed via fixed-mode caching
// C2/C3 excluded (NO-GO from Phase 77-1/79-1)
@ -65,6 +71,17 @@ static inline void tiny_legacy_fallback_free_base_with_env(void* base, uint32_t
}
break;
case 6:
// Phase 91: C6 Intrusive LIFO Inline Slots (check BEFORE FIFO)
if (tiny_c6_inline_slots_ifl_enabled_fast()) {
if (tiny_c6_inline_slots_ifl_push_fast(base)) {
FREE_PATH_STAT_INC(legacy_fallback);
if (__builtin_expect(free_path_stats_enabled(), 0)) {
g_free_path_stats.legacy_by_class[class_idx]++;
}
return;
}
}
// Phase 75-1: C6 Inline Slots (FIFO - fallback)
if (tiny_c6_inline_slots_enabled_fast()) {
if (c6_inline_push(c6_inline_tls(), base)) {
FREE_PATH_STAT_INC(legacy_fallback);
@ -126,6 +143,20 @@ static inline void tiny_legacy_fallback_free_base_with_env(void* base, uint32_t
// FULL → fall through to C6/unified cache
}
// Phase 91: C6 Intrusive LIFO Inline Slots early-exit (ENV gated)
// Try C6 IFL THIRD (before C6 FIFO and unified cache) for class 6
if (class_idx == 6 && tiny_c6_inline_slots_ifl_enabled_fast()) {
if (tiny_c6_inline_slots_ifl_push_fast(base)) {
// Success: pushed to C6 IFL
FREE_PATH_STAT_INC(legacy_fallback);
if (__builtin_expect(free_path_stats_enabled(), 0)) {
g_free_path_stats.legacy_by_class[class_idx]++;
}
return;
}
// FULL → fall through to C6 FIFO
}
// Phase 75-1: C6 Inline Slots early-exit (ENV gated)
// Try C6 inline slots THIRD (before unified cache) for class 6
if (class_idx == 6 && tiny_c6_inline_slots_enabled_fast()) {