Files
hakmem/core/box/c7_hotpath_env_box.h

16 lines
492 B
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// c7_hotpath_env_box.h - ENV gate for C7 hotpath
// Purpose: isolate the ENV handling so hotpath code can assume gate済み。
#pragma once
#include <stdlib.h>
// ENV gate: HAKMEM_TINY_C7_HOT=1 で有効化(デフォルト OFF
static inline int tiny_c7_hot_enabled(void) {
static int g_enable = -1;
if (__builtin_expect(g_enable == -1, 0)) {
const char* e = getenv("HAKMEM_TINY_C7_HOT");
g_enable = (e && *e && *e != '0') ? 1 : 0;
}
return g_enable;
}