changeset 7370:ec99dce065fb

8061449: G1: FreeRegionList_test() fails with G1 after the JDK-8058534 fix to HeapRegion::orig_end() Reviewed-by: mgerdin, tschatzl, stefank
author brutisso
date Wed, 05 Nov 2014 10:12:51 +0100
parents 32e3c9ec28b2
children f18a1b5cbf0b
files src/share/vm/gc_implementation/g1/heapRegionSet.cpp
diffstat 1 files changed, 13 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/gc_implementation/g1/heapRegionSet.cpp	Mon Nov 03 15:53:48 2014 +0100
+++ b/src/share/vm/gc_implementation/g1/heapRegionSet.cpp	Wed Nov 05 10:12:51 2014 +0100
@@ -426,11 +426,19 @@
                                          mtGC);
   G1BlockOffsetSharedArray oa(heap, bot_storage);
   bot_storage->commit_regions(0, num_regions_in_test);
-  HeapRegion hr0(0, &oa, heap);
-  HeapRegion hr1(1, &oa, heap);
-  HeapRegion hr2(2, &oa, heap);
-  HeapRegion hr3(3, &oa, heap);
-  HeapRegion hr4(4, &oa, heap);
+
+  // Set up memory regions for the heap regions.
+  MemRegion mr0(heap.start(), HeapRegion::GrainWords);
+  MemRegion mr1(mr0.end(), HeapRegion::GrainWords);
+  MemRegion mr2(mr1.end(), HeapRegion::GrainWords);
+  MemRegion mr3(mr2.end(), HeapRegion::GrainWords);
+  MemRegion mr4(mr3.end(), HeapRegion::GrainWords);
+
+  HeapRegion hr0(0, &oa, mr0);
+  HeapRegion hr1(1, &oa, mr1);
+  HeapRegion hr2(2, &oa, mr2);
+  HeapRegion hr3(3, &oa, mr3);
+  HeapRegion hr4(4, &oa, mr4);
   l.add_ordered(&hr1);
   l.add_ordered(&hr0);
   l.add_ordered(&hr3);