Merge "Add ashmem stats to Parcels"
This commit is contained in:
commit
8f91a6fb04
@ -337,6 +337,12 @@ public:
|
|||||||
public:
|
public:
|
||||||
inline void* data() { return mData; }
|
inline void* data() { return mData; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
private:
|
||||||
|
size_t mBlobAshmemSize;
|
||||||
|
|
||||||
|
public:
|
||||||
|
size_t getBlobAshmemSize() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
@ -938,6 +938,8 @@ status_t Parcel::writeBlob(size_t len, WritableBlob* outBlob)
|
|||||||
int fd = ashmem_create_region("Parcel Blob", len);
|
int fd = ashmem_create_region("Parcel Blob", len);
|
||||||
if (fd < 0) return NO_MEMORY;
|
if (fd < 0) return NO_MEMORY;
|
||||||
|
|
||||||
|
mBlobAshmemSize += len;
|
||||||
|
|
||||||
int result = ashmem_set_prot_region(fd, PROT_READ | PROT_WRITE);
|
int result = ashmem_set_prot_region(fd, PROT_READ | PROT_WRITE);
|
||||||
if (result < 0) {
|
if (result < 0) {
|
||||||
status = result;
|
status = result;
|
||||||
@ -1901,6 +1903,7 @@ void Parcel::initState()
|
|||||||
mFdsKnown = true;
|
mFdsKnown = true;
|
||||||
mAllowFds = true;
|
mAllowFds = true;
|
||||||
mOwner = NULL;
|
mOwner = NULL;
|
||||||
|
mBlobAshmemSize = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Parcel::scanForFds() const
|
void Parcel::scanForFds() const
|
||||||
@ -1918,6 +1921,11 @@ void Parcel::scanForFds() const
|
|||||||
mFdsKnown = true;
|
mFdsKnown = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t Parcel::getBlobAshmemSize() const
|
||||||
|
{
|
||||||
|
return mBlobAshmemSize;
|
||||||
|
}
|
||||||
|
|
||||||
// --- Parcel::Blob ---
|
// --- Parcel::Blob ---
|
||||||
|
|
||||||
Parcel::Blob::Blob() :
|
Parcel::Blob::Blob() :
|
||||||
|
Loading…
Reference in New Issue
Block a user