Skip to content

Commit de0b504

Browse files
author
Thomas Schatzl
committed
8336912: G1: Undefined behavior for G1ConfidencePercent=0
Reviewed-by: ayang, sangheki
1 parent e63d016 commit de0b504

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/hotspot/share/gc/g1/g1_globals.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112
\
113113
product(uint, G1ConfidencePercent, 50, \
114114
"Confidence level for MMU/pause predictions") \
115-
range(0, 100) \
115+
range(1, 100) \
116116
\
117117
product(uintx, G1SummarizeRSetStatsPeriod, 0, DIAGNOSTIC, \
118118
"The period (in number of GCs) at which we will generate " \

test/hotspot/jtreg/gc/arguments/TestG1PercentageOptions.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@ private static final class OptionDescription {
5151
}
5252
}
5353

54-
private static final String[] defaultValid = new String[] {
55-
"0", "1", "50", "95", "100" };
56-
private static final String[] defaultInvalid = new String[] {
57-
"-10", "110", "bad" };
54+
private static final String[] rangeOneToHundredValid = new String[] {
55+
"1", "50", "95", "100" };
56+
private static final String[] rangeOneToHundredInvalid = new String[] {
57+
"0", "-10", "110", "bad" };
5858

5959
// All of the G1 product arguments that are percentages.
6060
private static final OptionDescription[] percentOptions = new OptionDescription[] {
61-
new OptionDescription("G1ConfidencePercent", defaultValid, defaultInvalid)
61+
new OptionDescription("G1ConfidencePercent", rangeOneToHundredValid, rangeOneToHundredInvalid)
6262
// Other percentage options are not yet validated by argument processing.
6363
};
6464

0 commit comments

Comments
 (0)