< prev index next >

src/hotspot/share/gc/parallel/psYoungGen.cpp

Print this page
rev 56944 : imported patch 8233702-function-to-clamp-value-to-range

@@ -298,12 +298,11 @@
   assert(min_gen_size() <= orig_size && orig_size <= max_size(), "just checking");
 
   // Adjust new generation size
   const size_t eden_plus_survivors =
           align_up(eden_size + 2 * survivor_size, alignment);
-  size_t desired_size = MAX2(MIN2(eden_plus_survivors, max_size()),
-                             min_gen_size());
+  size_t desired_size = clamp(eden_plus_survivors, min_gen_size(), max_size());
   assert(desired_size <= max_size(), "just checking");
 
   if (desired_size > orig_size) {
     // Grow the generation
     size_t change = desired_size - orig_size;
< prev index next >