From 7a9e9cabc35831285c718da0f2b5d33637cbea43 Mon Sep 17 00:00:00 2001 From: yanghao Date: Sun, 27 Aug 2023 15:24:51 +0800 Subject: [PATCH] Fix Remove M1 limitation --- darwin/PlatformHelpers.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/darwin/PlatformHelpers.c b/darwin/PlatformHelpers.c index a4ea82beb..03b9bffe1 100644 --- a/darwin/PlatformHelpers.c +++ b/darwin/PlatformHelpers.c @@ -103,15 +103,12 @@ double Platform_calculateNanosecondsPerMachTick(void) { * the "Apple M1" chip specifically when running under Rosetta 2. */ - char cpuBrandString[1024] = ""; - Platform_getCPUBrandString(cpuBrandString, sizeof(cpuBrandString)); - bool isRunningUnderRosetta2 = Platform_isRunningTranslated(); // Kernel version 20.0.0 is macOS 11.0 (Big Sur) bool isBuggedVersion = Platform_KernelVersionIsBetween((KernelVersion) {20, 0, 0}, (KernelVersion) {999, 999, 999}); - if (isRunningUnderRosetta2 && String_eq(cpuBrandString, "Apple M1") && isBuggedVersion) { + if (isRunningUnderRosetta2 && isBuggedVersion) { // In this case `mach_timebase_info` provides the wrong value, so we hard-code the correct factor, // as determined from `mach_timebase_info` when the process running natively. info = (mach_timebase_info_data_t) { .numer = 125, .denom = 3 };