Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5a1d875c authored by Andreas Gampe's avatar Andreas Gampe Committed by android-build-merger
Browse files

Merge "Otapreopt: Add missing function" am: d760eb86 am: 70564d57

am: a9631050

Change-Id: I6ea81de874c4c5dbccdc9d0503f67c7bbb5adffd
parents 6e64dfe7 a9631050
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -88,6 +88,12 @@ static_assert(DEXOPT_MASK == (0x1dfe | DEXOPT_IDLE_BACKGROUND_JOB),
              "DEXOPT_MASK unexpected.");


template<typename T>
static constexpr bool IsPowerOfTwo(T x) {
  static_assert(std::is_integral<T>::value, "T must be integral");
  // TODO: assert unsigned. There is currently many uses with signed values.
  return (x & (x - 1)) == 0;
}

template<typename T>
static constexpr T RoundDown(T x, typename std::decay<T>::type n) {