< prev index next >

src/hotspot/share/gc/g1/g1Allocator.cpp

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

@@ -149,11 +149,11 @@
   HeapRegion* hr = mutator_alloc_region()->get();
   size_t max_tlab = _g1h->max_tlab_size() * wordSize;
   if (hr == NULL) {
     return max_tlab;
   } else {
-    return MIN2(MAX2(hr->free(), (size_t) MinTLABSize), max_tlab);
+    return clamp(hr->free(), MinTLABSize, max_tlab);
   }
 }
 
 size_t G1Allocator::used_in_alloc_regions() {
   assert(Heap_lock->owner() != NULL, "Should be owned on this thread's behalf.");
< prev index next >