Skip to content

Commit 644458b

Browse files
committed
CPU (macOS): try fixing CPU freq detection on Apple M4
Fix #1394
1 parent e618303 commit 644458b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/detection/cpu/cpu_apple.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,12 @@ static const char* detectFrequency(FFCPUResult* cpu)
5959
pMax = pMax > pStart[i] ? pMax : pStart[i];
6060

6161
if (pMax > 0)
62-
cpu->frequencyMax = pMax / 1000 / 1000;
62+
{
63+
if (pMax > 100000000) // Assume that pMax is in MHz, M1~M3
64+
cpu->frequencyMax = pMax / 1000 / 1000;
65+
else // Assume that pMax is in kHz, M4 and later (#1394)
66+
cpu->frequencyMax = pMax / 1000;
67+
}
6368

6469
return NULL;
6570
}

0 commit comments

Comments
 (0)