Skip to content

Commit c7d9ddb

Browse files
[GR-51179] Provide a method to set the physical memory size.
PullRequest: graal/16497
2 parents b939621 + 7e22c17 commit c7d9ddb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/heap/PhysicalMemory.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ public static boolean isInitializationInProgress() {
6363
return LOCK.isHeldByCurrentThread();
6464
}
6565

66+
@Uninterruptible(reason = "May only be called during early startup.")
67+
public static void setSize(UnsignedWord value) {
68+
VMError.guarantee(!isInitialized(), "PhysicalMemorySize must not be initialized yet.");
69+
cachedSize = value;
70+
}
71+
6672
/**
6773
* Returns the size of physical memory in bytes, querying it from the OS if it has not been
6874
* initialized yet.

0 commit comments

Comments
 (0)