Skip to content

Commit 8391196

Browse files
committed
8237884: ZGC: Use clamp() instead of MIN2(MAX2())
Reviewed-by: kbarrett, smonteith
1 parent 0f06a9a commit 8391196

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/hotspot/share/gc/z/zHeuristics.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,7 @@
2828
#include "logging/log.hpp"
2929
#include "runtime/globals.hpp"
3030
#include "runtime/os.hpp"
31+
#include "utilities/globalDefinitions.hpp"
3132
#include "utilities/powerOfTwo.hpp"
3233

3334
void ZHeuristics::set_medium_page_size() {
@@ -38,7 +39,7 @@ void ZHeuristics::set_medium_page_size() {
3839
const size_t min = ZGranuleSize;
3940
const size_t max = ZGranuleSize * 16;
4041
const size_t unclamped = MaxHeapSize * 0.03125;
41-
const size_t clamped = MIN2(MAX2(min, unclamped), max);
42+
const size_t clamped = clamp(unclamped, min, max);
4243
const size_t size = round_down_power_of_2(clamped);
4344

4445
if (size > ZPageSizeSmall) {

0 commit comments

Comments
 (0)