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

Commit 493ff6be authored by Kalesh Singh's avatar Kalesh Singh Committed by Gerrit Code Review
Browse files

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

parents abd5758e d6102197
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -224,6 +224,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;
@@ -249,7 +250,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);