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:
@ -80,7 +80,19 @@
|
||||
// - etc.
|
||||
//
|
||||
// This config box ONLY defines the macros that expand to function calls.
|
||||
// The functions themselves must be included/defined before using these macros.
|
||||
// The functions themselves are implemented here as static inline to avoid include order issues.
|
||||
|
||||
// Phase 7-Step6-Fix: Config wrapper functions (for normal mode)
|
||||
// These are static inline to access static global variables from any include order
|
||||
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;
|
||||
}
|
||||
|
||||
// Config macros (runtime function calls)
|
||||
// These expand to actual function calls in normal mode
|
||||
|
||||
Reference in New Issue
Block a user