Phase 7-Step6: Fix include order issue - refill path optimization complete

**Problem**: Include order dependency prevented using TINY_FRONT_FASTCACHE_ENABLED
macro in hakmem_tiny_refill.inc.h (included before tiny_alloc_fast.inc.h).

**Solution** (from ChatGPT advice):
- Move wrapper functions to tiny_front_config_box.h as static inline
- This makes them available regardless of include order
- Enables dead code elimination in PGO mode for refill path

**Changes**:
1. core/box/tiny_front_config_box.h:
   - Add tiny_fastcache_enabled() and sfc_cascade_enabled() as static inline
   - These access static global variables via extern declaration

2. core/hakmem_tiny_refill.inc.h:
   - Include tiny_front_config_box.h
   - Use TINY_FRONT_FASTCACHE_ENABLED macro (line 162)
   - Enables dead code elimination in PGO mode

3. core/tiny_alloc_fast.inc.h:
   - Remove duplicate wrapper function definitions
   - Now uses functions from config box header

**Performance**: 79.8M ops/s (maintained, 77M/81M/81M across 3 runs)

**Design Principle**: Config Box as "single entry point" for Tiny Front policy
- All config checks go through TINY_FRONT_*_ENABLED macros
- Wrapper functions centralized in config box header
- Include order independent (static inline in header)

🐱 Generated with ChatGPT advice for solving include order dependencies

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Moe Charm (CI)
2025-11-29 17:31:32 +09:00
parent 499f5e1527
commit ae00221a0a
3 changed files with 18 additions and 13 deletions

View File

@ -28,17 +28,8 @@
#endif
#include "hakmem_tiny_integrity.h" // PRIORITY 1-4: Corruption detection
// Phase 7-Step3: Config wrapper functions (for normal mode, eliminated in PGO mode)
// These functions wrap global enable flags for dead code elimination in PGO builds
static inline int tiny_fastcache_enabled(void) {
extern int g_fastcache_enable;
return g_fastcache_enable;
}
static inline int sfc_cascade_enabled(void) {
extern int g_sfc_enabled;
return g_sfc_enabled;
}
// Phase 7-Step6-Fix: Config wrapper functions moved to tiny_fastcache.c
// (Forward declarations are in tiny_front_config_box.h)
#ifdef HAKMEM_TINY_HEADER_CLASSIDX
// Ring Cache and Unified Cache removed (A/B test: OFF is faster)
#endif