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

Commit fd825692 authored by Juan Yescas's avatar Juan Yescas Committed by Automerger Merge Worker
Browse files

Merge "CachedAppOptimizer: Remove PAGE_MASK usage" into main am: 3b35e9d4

parents ddf73385 3b35e9d4
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -51,6 +51,9 @@ using android::base::WriteStringToFile;
using android::meminfo::ProcMemInfo;
using namespace android::meminfo;

static const size_t kPageSize = getpagesize();
static const size_t kPageMask = ~(kPageSize - 1);

#define COMPACT_ACTION_FILE_FLAG 1
#define COMPACT_ACTION_ANON_FLAG 2

@@ -61,7 +64,7 @@ using android::base::unique_fd;
#define ASYNC_RECEIVED_WHILE_FROZEN (2)
#define TXNS_PENDING_WHILE_FROZEN (4)

#define MAX_RW_COUNT (INT_MAX & PAGE_MASK)
#define MAX_RW_COUNT (INT_MAX & kPageMask)

// Defines the maximum amount of VMAs we can send per process_madvise syscall.
// Currently this is set to UIO_MAXIOV which is the maximum segments allowed by
@@ -224,7 +227,6 @@ 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;