diff options
author | 2015-12-04 14:19:04 +0000 | |
---|---|---|
committer | 2015-12-07 12:38:21 +0000 | |
commit | 88b2b80aed15bb1f931cddd40e44ca525ef10018 (patch) | |
tree | 04b2f9d27863cd469dae8050335f197496f24ff2 /runtime/base/bit_utils.h | |
parent | cf6bd55863ded11e0533966657871aca444505a5 (diff) |
Allow initializing runtime with parsed options.
Needed by upcoming refactoring of dex2oat to allow
early writing of dex files to the oat file.
Change-Id: Ia13c26132846801522f181f51f64035d625e8416
Diffstat (limited to 'runtime/base/bit_utils.h')
-rw-r--r-- | runtime/base/bit_utils.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/runtime/base/bit_utils.h b/runtime/base/bit_utils.h index d6a44f7293..8430d68d0e 100644 --- a/runtime/base/bit_utils.h +++ b/runtime/base/bit_utils.h @@ -23,6 +23,7 @@ #include "base/logging.h" #include "base/iteration_range.h" +#include "base/stl_util.h" namespace art { @@ -108,12 +109,12 @@ static inline int WhichPowerOf2(T x) { } // For rounding integers. -// NOTE: In the absence of std::omit_from_type_deduction<T> or std::identity<T>, use std::decay<T>. +// Note: Omit the `n` from T type deduction, deduce only from the `x` argument. template<typename T> -static constexpr T RoundDown(T x, typename std::decay<T>::type n) WARN_UNUSED; +static constexpr T RoundDown(T x, typename Identity<T>::type n) WARN_UNUSED; template<typename T> -static constexpr T RoundDown(T x, typename std::decay<T>::type n) { +static constexpr T RoundDown(T x, typename Identity<T>::type n) { return DCHECK_CONSTEXPR(IsPowerOfTwo(n), , T(0)) (x & -n); |