Skip to content

Commit

Permalink
Use 64k page size by default.
Browse files Browse the repository at this point in the history
  • Loading branch information
christianhaeubl committed Jan 24, 2024
1 parent cb0f826 commit d2debef
Showing 1 changed file with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ public static void updateMaxJavaStackTraceDepth(EconomicMap<OptionKey<?>, Object
@Option(help = "Color build output ('always', 'never', or 'auto')", type = OptionType.User)//
public static final HostedOptionKey<String> Color = new HostedOptionKey<>("auto");

public static final boolean hasColorsEnabled(OptionValues values) {
public static boolean hasColorsEnabled(OptionValues values) {
if (Color.hasBeenSet(values)) {
String value = Color.getValue(values);
return switch (value) {
Expand Down Expand Up @@ -871,6 +871,10 @@ protected void onValueUpdate(EconomicMap<OptionKey<?>, Object> values, Integer o
maxJavaStackTraceDepth = newValue;
}
};

/** Use {@link SubstrateOptions#getPageSize()} instead. */
@Option(help = "Define PageSize of a machine that runs the image. The default = 0 (== same as host machine page size)")//
protected static final HostedOptionKey<Integer> PageSize = new HostedOptionKey<>(0);
}

@Option(help = "Overwrites the available number of processors provided by the OS. Any value <= 0 means using the processor count from the OS.")//
Expand Down Expand Up @@ -934,14 +938,15 @@ public ReportingSupport(Path reportingPath) {
}
}

@Option(help = "Define PageSize of a machine that runs the image. The default = 0 (== same as host machine page size)")//
protected static final HostedOptionKey<Integer> PageSize = new HostedOptionKey<>(0);

@Fold
public static int getPageSize() {
int value = PageSize.getValue();
int value = ConcealedOptions.PageSize.getValue();
if (value == 0) {
return Unsafe.getUnsafe().pageSize();
/*
* Assume at least a 64k page size if none was specified. This maximizes compatibility
* because images can be executed as long as run-time page size <= build-time page size.
*/
return Math.max(64 * 1024, Unsafe.getUnsafe().pageSize());
}
assert value > 0 : value;
return value;
Expand Down

0 comments on commit d2debef

Please sign in to comment.