Skip to content

Commit c34b87c

Browse files
committed
8345659: Fix broken alignment after ReservedSpace splitting in GC code
Reviewed-by: ayang, aboldtch
1 parent e294899 commit c34b87c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/hotspot/share/gc/parallel/parallelScavengeHeap.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ jint ParallelScavengeHeap::initialize() {
7070

7171
initialize_reserved_region(heap_rs);
7272
// Layout the reserved space for the generations.
73-
ReservedSpace old_rs = heap_rs.first_part(MaxOldSize);
74-
ReservedSpace young_rs = heap_rs.last_part(MaxOldSize);
73+
ReservedSpace old_rs = heap_rs.first_part(MaxOldSize, GenAlignment);
74+
ReservedSpace young_rs = heap_rs.last_part(MaxOldSize, GenAlignment);
7575
assert(young_rs.size() == MaxNewSize, "Didn't reserve all of the heap");
7676

7777
PSCardTable* card_table = new PSCardTable(heap_rs.region());

src/hotspot/share/gc/serial/serialHeap.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,8 @@ jint SerialHeap::initialize() {
186186

187187
initialize_reserved_region(heap_rs);
188188

189-
ReservedSpace young_rs = heap_rs.first_part(MaxNewSize);
190-
ReservedSpace old_rs = heap_rs.last_part(MaxNewSize);
189+
ReservedSpace young_rs = heap_rs.first_part(MaxNewSize, GenAlignment);
190+
ReservedSpace old_rs = heap_rs.last_part(MaxNewSize, GenAlignment);
191191

192192
_rem_set = new CardTableRS(heap_rs.region());
193193
_rem_set->initialize(young_rs.base(), old_rs.base());

0 commit comments

Comments
 (0)