Skip to content

Commit

Permalink
bugfix for cores with too high numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
Jimmy-653 committed Oct 15, 2020
1 parent b0b148e commit d39bbfb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public static List<LogicalProcessor> getLogicalProcessorInformationEx() {
private static int getMatchingPackage(List<GROUP_AFFINITY[]> packages, int g, int lp) {
for (int i = 0; i < packages.size(); i++) {
for (int j = 0; j < packages.get(i).length; j++) {
if ((packages.get(i)[j].mask.longValue() & (1L << lp)) > 0 && packages.get(i)[j].group == g) {
if ((packages.get(i)[j].mask.longValue() & (1L << lp)) != 0 && packages.get(i)[j].group == g) {
return i;
}
}
Expand All @@ -122,7 +122,7 @@ private static int getMatchingPackage(List<GROUP_AFFINITY[]> packages, int g, in

private static int getMatchingNumaNode(List<NUMA_NODE_RELATIONSHIP> numaNodes, int g, int lp) {
for (int j = 0; j < numaNodes.size(); j++) {
if ((numaNodes.get(j).groupMask.mask.longValue() & (1L << lp)) > 0
if ((numaNodes.get(j).groupMask.mask.longValue() & (1L << lp)) != 0
&& numaNodes.get(j).groupMask.group == g) {
return numaNodes.get(j).nodeNumber;
}
Expand All @@ -132,7 +132,7 @@ private static int getMatchingNumaNode(List<NUMA_NODE_RELATIONSHIP> numaNodes, i

private static int getMatchingCore(List<GROUP_AFFINITY> cores, int g, int lp) {
for (int j = 0; j < cores.size(); j++) {
if ((cores.get(j).mask.longValue() & (1L << lp)) > 0 && cores.get(j).group == g) {
if ((cores.get(j).mask.longValue() & (1L << lp)) != 0 && cores.get(j).group == g) {
return j;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ private static List<LogicalProcessor> matchBitmasks(long group1, List<Long> grou

private static int getMatchingBitmask(List<Long> bitmasks, int lp) {
for (int j = 0; j < bitmasks.size(); j++) {
if ((bitmasks.get(j).longValue() & (1L << lp)) > 0) {
if ((bitmasks.get(j).longValue() & (1L << lp)) != 0) {
return j;
}
}
Expand Down

0 comments on commit d39bbfb

Please sign in to comment.