diff --git a/src/hotspot/share/gc/shared/genArguments.cpp b/src/hotspot/share/gc/shared/genArguments.cpp index fa0e675cf7343..3c1d1ac6ec1cd 100644 --- a/src/hotspot/share/gc/shared/genArguments.cpp +++ b/src/hotspot/share/gc/shared/genArguments.cpp @@ -58,7 +58,7 @@ static size_t bound_minus_alignment(size_t desired_size, size_t maximum_size, size_t alignment) { size_t max_minus = maximum_size - alignment; - return desired_size < max_minus ? desired_size : max_minus; + return MIN2(desired_size, max_minus); } void GenArguments::initialize_alignments() {