summaryrefslogtreecommitdiffstats
path: root/libs/binder
diff options
context:
space:
mode:
authorDan Sandler <dsandler@android.com>2015-04-21 14:10:17 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-04-21 14:10:23 +0000
commit8f91a6fb040ca22dde5408426abea28ac03d0c86 (patch)
treec7bfc98b56c49dfee391a289167b2c8eac1d211d /libs/binder
parent3804378e6a768f539d622ce6a1121d39d9f79e51 (diff)
parentaa5c2346c7291465aaca53f59878582dccbe4835 (diff)
downloadframeworks_native-8f91a6fb040ca22dde5408426abea28ac03d0c86.zip
frameworks_native-8f91a6fb040ca22dde5408426abea28ac03d0c86.tar.gz
frameworks_native-8f91a6fb040ca22dde5408426abea28ac03d0c86.tar.bz2
Merge "Add ashmem stats to Parcels"
Diffstat (limited to 'libs/binder')
-rw-r--r--libs/binder/Parcel.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/libs/binder/Parcel.cpp b/libs/binder/Parcel.cpp
index d4dd8c7..0e11d53 100644
--- a/libs/binder/Parcel.cpp
+++ b/libs/binder/Parcel.cpp
@@ -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() :