Skip to content

Commit 8d3d439

Browse files
committed
8292903: enhance round_up_power_of_2 assertion output
Reviewed-by: stefank, stuefe
1 parent 054c23f commit 8d3d439

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/hotspot/share/utilities/powerOfTwo.hpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2019, 2022, 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
@@ -103,7 +103,8 @@ inline T round_down_power_of_2(T value) {
103103
template<typename T, ENABLE_IF(std::is_integral<T>::value)>
104104
inline T round_up_power_of_2(T value) {
105105
assert(value > 0, "Invalid value");
106-
assert(value <= max_power_of_2<T>(), "Overflow");
106+
assert(value <= max_power_of_2<T>(), "Overflowing maximum allowed power of two with " UINT64_FORMAT_X,
107+
static_cast<uint64_t>(value));
107108
if (is_power_of_2(value)) {
108109
return value;
109110
}

0 commit comments

Comments
 (0)