Priority-2 ENV Cache: Shared Pool Release (1箇所置換)

【置換ファイル】
- core/hakmem_shared_pool_release.c (1箇所 → ENV Cache)

【変更詳細】
- getenv("HAKMEM_SS_FREE_DEBUG") → HAK_ENV_SS_FREE_DEBUG()
- #include "hakmem_env_cache.h" 追加
- static変数の遅延初期化パターンを削除

【効果】
- Shared Pool Release pathからgetenv()呼び出しを排除
- SS_FREE_DEBUG変数は既にENV Cacheに登録済み (Hot Path Free系)

【テスト】
 make shared → 成功
 /tmp/test_mixed3_final → PASSED

🤖 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-12-02 20:52:48 +09:00
parent c482722705
commit 183b106733

View File

@ -2,6 +2,7 @@
#include "hakmem_debug_master.h" #include "hakmem_debug_master.h"
#include "box/ss_slab_meta_box.h" #include "box/ss_slab_meta_box.h"
#include "box/ss_hot_cold_box.h" #include "box/ss_hot_cold_box.h"
#include "hakmem_env_cache.h" // Priority-2: ENV cache
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
@ -45,11 +46,8 @@ shared_pool_release_slab(SuperSlab* ss, int slab_idx)
// Debug logging // Debug logging
#if !HAKMEM_BUILD_RELEASE #if !HAKMEM_BUILD_RELEASE
static int dbg = -1; // Priority-2: Use cached ENV
if (__builtin_expect(dbg == -1, 0)) { int dbg = HAK_ENV_SS_FREE_DEBUG();
const char* e = getenv("HAKMEM_SS_FREE_DEBUG");
dbg = (e && *e && *e != '0') ? 1 : 0;
}
#else #else
static const int dbg = 0; static const int dbg = 0;
#endif #endif