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

Commit bb25444a authored by Kalesh Singh's avatar Kalesh Singh Committed by Automerger Merge Worker
Browse files

Merge "CachedAppOptimizer: Remove use of hardcoded PAGE_SIZE 4096" into main...

Merge "CachedAppOptimizer: Remove use of hardcoded PAGE_SIZE 4096" into main am: 493ff6be am: 745808fc

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2700537



Change-Id: I84b812cbed100ed6dd786675cde8bf4e2167f600
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 0467a24f 745808fc
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -233,6 +233,7 @@ public:
// process_madvise on failure
int madviseVmasFromBatch(unique_fd& pidfd, VmaBatch& batch, int madviseType,
                         uint64_t* outBytesProcessed) {
    static const size_t kPageSize = getpagesize();
    if (batch.totalVmas == 0 || batch.totalBytes == 0) {
        // No VMAs in Batch, skip.
        *outBytesProcessed = 0;
@@ -258,7 +259,7 @@ int madviseVmasFromBatch(unique_fd& pidfd, VmaBatch& batch, int madviseType,
    } else if (bytesProcessedInSend < batch.totalBytes) {
        // Partially processed the bytes requested
        // skip last page which is where it failed.
        bytesProcessedInSend += PAGE_SIZE;
        bytesProcessedInSend += kPageSize;
    }
    bytesProcessedInSend = consumeBytes(batch, bytesProcessedInSend);