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:
@ -19,6 +19,7 @@
|
||||
#include "superslab/superslab_inline.h"
|
||||
#include "box/tls_sll_box.h"
|
||||
#include "box/tiny_header_box.h" // Header Box: Single Source of Truth for header operations
|
||||
#include "box/tiny_front_config_box.h" // Phase 7-Step6-Fix: Config macros for dead code elimination
|
||||
#include "hakmem_tiny_integrity.h"
|
||||
#include "box/tiny_next_ptr_box.h"
|
||||
#include "tiny_region_id.h" // For HEADER_MAGIC/HEADER_CLASS_MASK (prepare header before SLL push)
|
||||
@ -157,7 +158,8 @@ static inline void* superslab_tls_bump_fast(int class_idx) {
|
||||
|
||||
static inline void* tiny_fast_refill_and_take(int class_idx, TinyTLSList* tls) {
|
||||
// 1) Front FastCache から直接
|
||||
if (__builtin_expect(g_fastcache_enable && class_idx <= 3, 1)) {
|
||||
// Phase 7-Step6-Fix: Use config macro for dead code elimination in PGO mode
|
||||
if (__builtin_expect(TINY_FRONT_FASTCACHE_ENABLED && class_idx <= 3, 1)) {
|
||||
void* fc = fastcache_pop(class_idx);
|
||||
if (fc) {
|
||||
extern unsigned long long g_front_fc_hit[TINY_NUM_CLASSES];
|
||||
|
||||
Reference in New Issue
Block a user