@@ -180,9 +180,9 @@ class DisjointPool::AllocImpl {
180180 // Powers of 2 and the value halfway between the powers of 2.
181181 auto Size1 = this ->params .MinBucketSize ;
182182 // MinBucketSize cannot be larger than CutOff.
183- Size1 = std::min (Size1, CutOff);
183+ Size1 = utils_min (Size1, CutOff);
184184 // Buckets sized smaller than the bucket default size- 8 aren't needed.
185- Size1 = std::max (Size1, UMF_DISJOINT_POOL_MIN_BUCKET_DEFAULT_SIZE);
185+ Size1 = utils_max (Size1, UMF_DISJOINT_POOL_MIN_BUCKET_DEFAULT_SIZE);
186186 // Calculate the exponent for MinBucketSize used for finding buckets.
187187 MinBucketSizeExp = (size_t )log2Utils (Size1);
188188 auto Size2 = Size1 + Size1 / 2 ;
@@ -387,11 +387,13 @@ void bucket_update_stats(bucket_t *bucket, int InUse, int InPool) {
387387 return ;
388388 }
389389 bucket->currSlabsInUse += InUse;
390+
390391 bucket->maxSlabsInUse =
391- std::max (bucket->currSlabsInUse , bucket->maxSlabsInUse );
392+ utils_max (bucket->currSlabsInUse , bucket->maxSlabsInUse );
392393 bucket->currSlabsInPool += InPool;
393394 bucket->maxSlabsInPool =
394- std::max (bucket->currSlabsInPool , bucket->maxSlabsInPool );
395+ utils_max (bucket->currSlabsInPool , bucket->maxSlabsInPool );
396+
395397 // Increment or decrement current pool sizes based on whether
396398 // slab was added to or removed from pool.
397399 bucket_get_params (bucket)->CurPoolSize +=
@@ -605,10 +607,10 @@ void DisjointPool::AllocImpl::printStats(bool &TitlePrinted,
605607 // (*B).printStats(TitlePrinted, MTName);
606608 bucket_t *bucket = B;
607609 HighPeakSlabsInUse =
608- std::max (bucket->maxSlabsInUse , HighPeakSlabsInUse);
610+ utils_max (bucket->maxSlabsInUse , HighPeakSlabsInUse);
609611 if ((*B).allocCount ) {
610612 HighBucketSize =
611- std::max (bucket_slab_alloc_size (bucket), HighBucketSize);
613+ utils_max (bucket_slab_alloc_size (bucket), HighBucketSize);
612614 }
613615 }
614616}
0 commit comments