@@ -66,9 +66,9 @@ std::string get_machine() {
6666 GetNativeSystemInfo (&sysInfo);
6767 switch (sysInfo.wProcessorArchitecture ) {
6868 case PROCESSOR_ARCHITECTURE_AMD64:
69- return ARCH_X86_64;
69+ return std::string ( ARCH_X86_64) ;
7070 case PROCESSOR_ARCHITECTURE_ARM64:
71- return ARCH_AARCH64;
71+ return std::string ( ARCH_AARCH64) ;
7272 case PROCESSOR_ARCHITECTURE_INTEL:
7373 return " i686" ;
7474 default :
@@ -80,13 +80,13 @@ std::string get_machine() {
8080 size_t size = sizeof (brand);
8181 if (sysctlbyname (" machdep.cpu.brand_string" , brand, &size, nullptr , 0 ) == 0 ) {
8282 if (std::string (brand).find (" Apple" ) != std::string::npos)
83- return ARCH_AARCH64;
83+ return std::string ( ARCH_AARCH64) ;
8484 }
8585 struct utsname uts;
8686 if (uname (&uts) == 0 ) {
8787 std::string machine = uts.machine ;
8888 if (machine == " arm64" )
89- return ARCH_AARCH64;
89+ return std::string ( ARCH_AARCH64) ;
9090 return machine;
9191 }
9292 return " unknown" ;
@@ -95,9 +95,9 @@ std::string get_machine() {
9595 if (uname (&uts) == 0 ) {
9696 std::string machine = uts.machine ;
9797 if (machine == " arm64" )
98- return ARCH_AARCH64;
98+ return std::string ( ARCH_AARCH64) ;
9999 if (machine == " amd64" )
100- return ARCH_X86_64;
100+ return std::string ( ARCH_X86_64) ;
101101 return machine;
102102 }
103103 return " unknown" ;
@@ -378,7 +378,7 @@ std::optional<std::string> brand_string() {
378378
379379namespace compatibility {
380380
381- static bool is_in_family (const Microarchitecture& target, const std::string& family_name) {
381+ static bool is_in_family (const Microarchitecture& target, std::string_view family_name) {
382382 if (target.name () == family_name)
383383 return true ;
384384 for (const auto & ancestor : target.ancestors ()) {
@@ -416,11 +416,11 @@ bool check_aarch64(const DetectedCpuInfo& info, const Microarchitecture& target)
416416
417417#if defined(__APPLE__)
418418 if (!info.name .empty ()) {
419- const auto * model = MicroarchitectureDatabase::instance ().get (info.name );
419+ auto model = MicroarchitectureDatabase::instance ().get (info.name );
420420 if (model) {
421421 if (target.name () == info.name )
422422 return true ;
423- for (const auto & ancestor : model->ancestors ()) {
423+ for (const auto & ancestor : model->get (). ancestors ()) {
424424 if (ancestor == target.name ())
425425 return true ;
426426 }
@@ -446,7 +446,7 @@ bool check_riscv64(const DetectedCpuInfo& info, const Microarchitecture& target)
446446} // namespace compatibility
447447
448448std::vector<const Microarchitecture*> compatible_microarchitectures (const DetectedCpuInfo& info,
449- const std::string& arch) {
449+ std::string_view arch) {
450450 std::vector<const Microarchitecture*> result;
451451 const auto & db = MicroarchitectureDatabase::instance ();
452452
@@ -460,8 +460,8 @@ std::vector<const Microarchitecture*> compatible_microarchitectures(const Detect
460460 else if (arch == ARCH_RISCV64)
461461 checker = compatibility::check_riscv64;
462462 else {
463- if (const auto * generic = db.get (arch))
464- result.push_back (generic);
463+ if (auto generic = db.get (arch))
464+ result.push_back (& generic-> get () );
465465 return result;
466466 }
467467
@@ -471,8 +471,8 @@ std::vector<const Microarchitecture*> compatible_microarchitectures(const Detect
471471 }
472472
473473 if (result.empty ()) {
474- if (const auto * generic = db.get (arch))
475- result.push_back (generic);
474+ if (auto generic = db.get (arch))
475+ result.push_back (& generic-> get () );
476476 }
477477
478478 return result;
0 commit comments