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

Commit 0774f487 authored by Jeff Brown's avatar Jeff Brown Committed by Android Git Automerger
Browse files

am 1b678528: Merge "Fix invalid madvise() during concurrent alloc/dealloc of MemoryDealer"

* commit '1b678528237d4eea623840ce3ba5520c59ca4b2c':
  Fix invalid madvise() during concurrent alloc/dealloc of MemoryDealer
parents 64ef9006 a621e426
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -180,7 +180,6 @@ Allocation::~Allocation()
        /* NOTE: it's VERY important to not free allocations of size 0 because
         * they're special as they don't have any record in the allocator
         * and could alias some real allocation (their offset is zero). */
        mDealer->deallocate(freedOffset);

        // keep the size to unmap in excess
        size_t pagesize = getpagesize();
@@ -216,6 +215,11 @@ Allocation::~Allocation()
            }
#endif
        }

        // This should be done after madvise(MADV_REMOVE), otherwise madvise()
        // might kick out the memory region that's allocated and/or written
        // right after the deallocation.
        mDealer->deallocate(freedOffset);
    }
}