Skip to content

Commit b8b46b2

Browse files
committed
rtc/hwloc/shmem: fix "libs" hole search kind
We want the biggest hole *between* heap and stack, not outside. Signed-off-by: Brice Goglin <[email protected]>
1 parent a3e31fa commit b8b46b2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

orte/mca/rtc/hwloc/rtc_hwloc.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,15 +594,18 @@ static int find_hole(orte_rtc_hwloc_vm_hole_kind_t hkind,
594594
break;
595595

596596
case VM_HOLE_IN_LIBS:
597+
/* see if we are between heap and stack */
597598
if (prevmkind == VM_MAP_HEAP) {
598599
in_libs = 1;
599600
}
600601
if (mkind == VM_MAP_STACK) {
601602
in_libs = 0;
602603
}
603-
if (in_libs) {
604+
if (!in_libs) {
605+
/* we're not in libs, ignore this entry */
604606
break;
605607
}
608+
/* we're in libs, consider this entry for searching the biggest hole below */
606609
/* fallthrough */
607610

608611
case VM_HOLE_BIGGEST:

0 commit comments

Comments
 (0)