Commit Graph

1 Commits

Author SHA1 Message Date
b01c99f209 Phase: Pool API Modularization - Steps 1-2
Extract configuration, statistics, and caching boxes from pool_api.inc.h

Step 1: pool_config_box.h (60 lines)
  - All ENV gate predicates (hak_pool_v2_enabled, hak_pool_v1_flatten_enabled, etc)
  - Lazy static int cache pattern (matches tiny_heap_env_box.h style)
  - Zero dependencies (lowest-level box)

Step 2a: pool_stats_box.h (90 lines)
  - PoolV1FlattenStats structure with multi-phase support
  - pool_v1_flat_stats_dump() with phase-aware output
  - Destructor hook for automatic dumping on exit
  - Multi-phase design: supports future phases without refactoring

Step 2b: pool_mid_desc_cache_box.h (60 lines)
  - MidDescCache structure (TLS-local single-entry LRU)
  - mid_desc_lookup_cached() with fast TLS hit path
  - Minimal external dependency: mid_desc_lookup from pool_mid_desc.inc.h

Result: pool_api.inc.h reduced from 1050+ lines to ~950 lines
  Still contains: alloc/free implementations, helpers (next steps)

Build:  Clean (no warnings)
Test:  Benchmark passes (8.5M ops/s)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-12 21:39:18 +09:00