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

Commit b7ab38e1 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix SharedMemory.MemoryRegistration.size calculation when PAGE_SIZE is 0." into main

parents ec381047 76872602
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -381,10 +381,12 @@ public final class SharedMemory implements Parcelable, Closeable {
        private MemoryRegistration(int size) {
            // Round up to the nearest page size
            final int PAGE_SIZE = OsConstants._SC_PAGE_SIZE;
            if (PAGE_SIZE > 0) {
                final int remainder = size % PAGE_SIZE;
                if (remainder != 0) {
                    size += PAGE_SIZE - remainder;
                }
            }
            mSize = size;
            mReferenceCount = 1;
            VMRuntime.getRuntime().registerNativeAllocation(mSize);