Add v4 C7/C6 fast classify and small-segment v4 scaffolding

This commit is contained in:
Moe Charm (CI)
2025-12-10 19:14:38 +09:00
parent 3261025995
commit f2ce7256cd
11 changed files with 221 additions and 17 deletions

View File

@ -0,0 +1,28 @@
// smallsegment_v4_env_box.h - small-object segment v4 の ENV ゲート
// Phase PF2: ENV を宣言するだけ。実装は次フェーズで追加。
#pragma once
#include <stdlib.h>
static inline int smallsegment_v4_enabled(void) {
static int g = -1;
if (__builtin_expect(g == -1, 0)) {
const char* e = getenv("HAKMEM_SMALL_SEGMENT_V4_ENABLED");
if (e && *e && *e != '0') {
g = 1;
} else {
g = 0;
}
}
return g;
}
static inline const char* smallsegment_v4_size_env(void) {
static int g_init = 0;
static const char* g_val = NULL;
if (__builtin_expect(!g_init, 0)) {
g_val = getenv("HAKMEM_SMALL_SEGMENT_V4_SIZE");
g_init = 1;
}
return g_val;
}