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

Commit aa5c2346 authored by Dan Sandler's avatar Dan Sandler Committed by Daniel Sandler
Browse files

Add ashmem stats to Parcels

Requires change Ifaf115da in frameworks/base.

Bug: 20079551
Change-Id: Ifaf115dabd1a59cdb1b46e2d49c41f64ac107de4
parent 66828572
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -337,6 +337,12 @@ public:
    public:
        inline void* data() { return mData; }
    };

private:
    size_t mBlobAshmemSize;

public:
    size_t getBlobAshmemSize() const;
};

// ---------------------------------------------------------------------------
+8 −0
Original line number Diff line number Diff line
@@ -938,6 +938,8 @@ status_t Parcel::writeBlob(size_t len, WritableBlob* outBlob)
    int fd = ashmem_create_region("Parcel Blob", len);
    if (fd < 0) return NO_MEMORY;

    mBlobAshmemSize += len;

    int result = ashmem_set_prot_region(fd, PROT_READ | PROT_WRITE);
    if (result < 0) {
        status = result;
@@ -1901,6 +1903,7 @@ void Parcel::initState()
    mFdsKnown = true;
    mAllowFds = true;
    mOwner = NULL;
    mBlobAshmemSize = 0;
}

void Parcel::scanForFds() const
@@ -1918,6 +1921,11 @@ void Parcel::scanForFds() const
    mFdsKnown = true;
}

size_t Parcel::getBlobAshmemSize() const
{
    return mBlobAshmemSize;
}

// --- Parcel::Blob ---

Parcel::Blob::Blob() :