diff options
| author | 2020-07-29 23:59:43 +0000 | |
|---|---|---|
| committer | 2020-07-29 23:59:43 +0000 | |
| commit | 8be3ef78926a5f70ad76f4766b6fb81c8aee4c37 (patch) | |
| tree | 614440e9f768a059d6b8cd9cf54538d6cd5d1ba3 | |
| parent | 21223593dd29bb91f92d2af146a7b5aee9068a82 (diff) | |
| parent | f7476791b076dd9dac31ff288a4d52b862e362a5 (diff) | |
Merge "Remove sole "user" of DCHECK_CONSTEXPR." am: 25be6e9109 am: 22558534ce am: 68f469d8d5 am: f7476791b0
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/1377807
Change-Id: I558cb69d6838b1054542c90dffa3a7f5285c2415
| -rw-r--r-- | cmds/installd/otapreopt.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/cmds/installd/otapreopt.cpp b/cmds/installd/otapreopt.cpp index 18f8268bf3..9c757815ae 100644 --- a/cmds/installd/otapreopt.cpp +++ b/cmds/installd/otapreopt.cpp @@ -96,7 +96,7 @@ static constexpr bool IsPowerOfTwo(T x) { template<typename T> static constexpr T RoundDown(T x, typename std::decay<T>::type n) { - return DCHECK_CONSTEXPR(IsPowerOfTwo(n), , T(0))(x & -n); + return (x & -n); } template<typename T> @@ -523,6 +523,7 @@ private: // Choose a random relocation offset. Taken from art/runtime/gc/image_space.cc. static int32_t ChooseRelocationOffsetDelta(int32_t min_delta, int32_t max_delta) { constexpr size_t kPageSize = PAGE_SIZE; + static_assert(IsPowerOfTwo(kPageSize), "page size must be power of two"); CHECK_EQ(min_delta % kPageSize, 0u); CHECK_EQ(max_delta % kPageSize, 0u); CHECK_LT(min_delta, max_delta); |