Skip to content

Commit 59a8993

Browse files
committed
[GR-55602] Memory mapping of image heap no longer works on Windows.
PullRequest: graal/18355
2 parents 40cfa00 + d7ae428 commit 59a8993

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

substratevm/src/com.oracle.svm.core.genscavenge/src/com/oracle/svm/core/genscavenge/ChunkedImageHeapLayouter.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929

3030
import org.graalvm.word.UnsignedWord;
3131

32+
import com.oracle.svm.core.SubstrateOptions;
3233
import com.oracle.svm.core.SubstrateUtil;
3334
import com.oracle.svm.core.config.ConfigurationValues;
3435
import com.oracle.svm.core.genscavenge.ChunkedImageHeapAllocator.AlignedChunk;
@@ -84,7 +85,7 @@ public ChunkedImageHeapLayouter(ImageHeapInfo heapInfo, long startOffset) {
8485
this.partitions[READ_ONLY_RELOCATABLE] = new ChunkedImageHeapPartition("readOnlyRelocatable", false, false, alignment, alignment);
8586
this.partitions[WRITABLE_REGULAR] = new ChunkedImageHeapPartition("writable", true, false, alignment, alignment);
8687
this.partitions[WRITABLE_HUGE] = new ChunkedImageHeapPartition("writableHuge", true, true, alignment, alignment);
87-
this.partitions[READ_ONLY_HUGE] = new ChunkedImageHeapPartition("readOnlyHuge", false, true, alignment, alignment);
88+
this.partitions[READ_ONLY_HUGE] = new ChunkedImageHeapPartition("readOnlyHuge", false, true, alignment, SubstrateOptions.getPageSize());
8889

8990
this.heapInfo = heapInfo;
9091
this.startOffset = startOffset;
@@ -140,6 +141,7 @@ public ImageHeapLayoutInfo layout(ImageHeap imageHeap, int pageSize) {
140141
assert partition.getStartOffset() % partition.getStartAlignment() == 0 : partition;
141142
assert (partition.getStartOffset() + partition.getSize()) % partition.getEndAlignment() == 0 : partition;
142143
}
144+
assert layoutInfo.getImageHeapSize() % pageSize == 0 : "Image heap size is not a multiple of page size";
143145
return layoutInfo;
144146
}
145147

0 commit comments

Comments
 (0)