cpu features stored in static oncemore

This commit is contained in:
lizzie
2026-08-31 03:34:46 +00:00
parent d918efbea5
commit 5edb9d37ef
@@ -76,8 +76,7 @@ void ProtectMemory(const void* base, size_t size, bool is_executable) {
} }
#endif #endif
HostFeature GetHostFeatures() { static const HostFeature features = []() {
HostFeature features = {};
#ifdef DYNARMIC_ENABLE_CPU_FEATURE_DETECTION #ifdef DYNARMIC_ENABLE_CPU_FEATURE_DETECTION
using Cpu = Xbyak::util::Cpu; using Cpu = Xbyak::util::Cpu;
Xbyak::util::Cpu cpu_info{}; Xbyak::util::Cpu cpu_info{};
@@ -144,6 +143,8 @@ HostFeature GetHostFeatures() {
} }
} }
#endif #endif
}();
HostFeature GetHostFeatures() {
return features; return features;
} }