< prev index next >

src/hotspot/share/gc/serial/defNewGeneration.cpp

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

@@ -390,11 +390,11 @@
   // Compute desired new generation size based on NewRatio and NewSizeThreadIncrease
   // and reverts to previous value if any overflow happens
   size_t desired_new_size = adjust_for_thread_increase(new_size_candidate, new_size_before, alignment);
 
   // Adjust new generation size
-  desired_new_size = MAX2(MIN2(desired_new_size, max_new_size), min_new_size);
+  desired_new_size = clamp(desired_new_size, min_new_size, max_new_size);
   assert(desired_new_size <= max_new_size, "just checking");
 
   bool changed = false;
   if (desired_new_size > new_size_before) {
     size_t change = desired_new_size - new_size_before;
< prev index next >