We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0724863 commit d515e2eCopy full SHA for d515e2e
linux/LinuxMachine.c
@@ -739,13 +739,12 @@ static void LinuxMachine_computeThreadIndices(LinuxMachine* this) {
739
because CoreIDs are not contiguous or because cpus are
740
enumerated in an alternative order, or both. */
741
for (size_t i = 1; i <= super->existingCPUs; i++) {
742
- int coreIndex = 0;
743
- for (size_t j = 1; j < i; j++) {
+ for (size_t j = i - 1; j >= 1; j--) {
744
if (cpus[i].threadIndex == cpus[j].threadIndex) {
745
- coreIndex++;
+ cpus[i].coreIndex = cpus[j].coreIndex + 1;
+ break;
746
}
747
748
- cpus[i].coreIndex = coreIndex;
749
750
751
/* Set core & thread indices to zero for cpu0 (average) */
0 commit comments