We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9258d0f commit 02ba122Copy full SHA for 02ba122
1 file changed
cpuid.go
@@ -881,7 +881,12 @@ func physicalCores() int {
881
v, _ := vendorID()
882
switch v {
883
case Intel:
884
- return logicalCores() / threadsPerCore()
+ lc := logicalCores()
885
+ tpc := threadsPerCore()
886
+ if lc > 0 && tpc > 0 {
887
+ return lc / tpc
888
+ }
889
+ return 0
890
case AMD, Hygon:
891
lc := logicalCores()
892
tpc := threadsPerCore()
0 commit comments