Files
hakmem/core/box/smallsegment_v4_env_box.h

29 lines
756 B
C

// 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;
}