Index: src/utils.h |
diff --git a/src/utils.h b/src/utils.h |
index 6c8dadbd715f363672bc7a8cf260e3a05b4a327b..d16c345cd2982653e279e34835138b113341d018 100644 |
--- a/src/utils.h |
+++ b/src/utils.h |
@@ -185,6 +185,11 @@ inline bool IsAddressAligned(Address addr, |
return IsAligned(offs, alignment); |
} |
+template <typename T, typename U> |
+inline T RoundUpToMultipleOfPowOf2(T value, U multiple) { |
+ DCHECK(multiple && ((multiple & (multiple - 1)) == 0)); |
Clemens Hammacher
2017/05/18 11:52:05
There is base::bits::IsPowerOfTwo64.
ivica.bogosavljevic
2017/05/18 12:21:43
Acknowledged.
|
+ return (value + multiple - 1) & ~(multiple - 1); |
+} |
// Returns the maximum of the two parameters. |
template <typename T> |