Index: src/utils.h |
diff --git a/src/utils.h b/src/utils.h |
index 45e397ac10f18e1d6a357e6fcf2540455c10367d..acc06d3afaaddffc4e55fbdf902b956a9cdaf541 100644 |
--- a/src/utils.h |
+++ b/src/utils.h |
@@ -192,6 +192,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)); |
+ return (value + multiple - 1) & ~(multiple - 1); |
+} |
// Returns the maximum of the two parameters. |
template <typename T> |