Add v4 C7/C6 fast classify and small-segment v4 scaffolding
This commit is contained in:
28
core/box/smallsegment_v4_env_box.h
Normal file
28
core/box/smallsegment_v4_env_box.h
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user