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

Commit d686176a authored by Michael Bestas's avatar Michael Bestas
Browse files

Merge tag 'android-10.0.0_r23' into staging/lineage-17.1_merge-android-10.0.0_r23

Android 10.0.0 release 23

* tag 'android-10.0.0_r23':
  FlattenableUtils::align memsets

Change-Id: I4042ad902074d4cc8c5953cfe27f8bb34fdbdb01
parents 6b664ff0 eaab99db
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -47,7 +47,12 @@ public:

    template<size_t N>
    static size_t align(void*& buffer) {
        return align<N>( const_cast<void const*&>(buffer) );
        static_assert(!(N & (N - 1)), "Can only align to a power of 2.");
        void* b = buffer;
        buffer = reinterpret_cast<void*>((uintptr_t(buffer) + (N-1)) & ~(N-1));
        size_t delta = size_t(uintptr_t(buffer) - uintptr_t(b));
        memset(b, 0, delta);
        return delta;
    }

    static void advance(void*& buffer, size_t& size, size_t offset) {