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
HostFeature GetHostFeatures() {
HostFeature features = {};
static const HostFeature features = []() {
#ifdef DYNARMIC_ENABLE_CPU_FEATURE_DETECTION
using Cpu = Xbyak::util::Cpu;
Xbyak::util::Cpu cpu_info{};
@@ -144,6 +143,8 @@ HostFeature GetHostFeatures() {
}
}
#endif
}();
HostFeature GetHostFeatures() {
return features;
}