diff options
author | 2020-03-05 23:17:30 +0000 | |
---|---|---|
committer | 2020-03-05 23:17:30 +0000 | |
commit | c865e256b9d96a697def097fe89bd0d03444edeb (patch) | |
tree | ce7f7de67b710de3f95065c6026cc68f1a369ed2 | |
parent | 11f9bbf44971994ff4aecebb06321a9f06a76d9e (diff) | |
parent | 06074d8846fdf2180ed2b2b7a23226e3ba364720 (diff) |
Merge "Revert "Optimize BpBinder struct size.""
-rw-r--r-- | libs/binder/BpBinder.cpp | 14 | ||||
-rw-r--r-- | libs/binder/include/binder/BpBinder.h | 7 |
2 files changed, 11 insertions, 10 deletions
diff --git a/libs/binder/BpBinder.cpp b/libs/binder/BpBinder.cpp index cadf15ef28..d2b9b8f018 100644 --- a/libs/binder/BpBinder.cpp +++ b/libs/binder/BpBinder.cpp @@ -139,10 +139,10 @@ BpBinder* BpBinder::create(int32_t handle) { BpBinder::BpBinder(int32_t handle, int32_t trackedUid) : mHandle(handle) , mStability(0) - , mTrackedUid(trackedUid) - , mAlive(true) - , mObitsSent(false) + , mAlive(1) + , mObitsSent(0) , mObituaries(nullptr) + , mTrackedUid(trackedUid) { ALOGV("Creating BpBinder %p handle %d\n", this, mHandle); @@ -185,7 +185,7 @@ const String16& BpBinder::getInterfaceDescriptor() const bool BpBinder::isBinderAlive() const { - return mAlive; + return mAlive != 0; } status_t BpBinder::pingBinder() @@ -236,7 +236,7 @@ status_t BpBinder::transact( status_t status = IPCThreadState::self()->transact( mHandle, code, data, reply, flags); - if (status == DEAD_OBJECT) mAlive = false; + if (status == DEAD_OBJECT) mAlive = 0; return status; } @@ -320,7 +320,7 @@ void BpBinder::sendObituary() ALOGV("Sending obituary for proxy %p handle %d, mObitsSent=%s\n", this, mHandle, mObitsSent ? "true" : "false"); - mAlive = false; + mAlive = 0; if (mObitsSent) return; mLock.lock(); @@ -332,7 +332,7 @@ void BpBinder::sendObituary() self->flushCommands(); mObituaries = nullptr; } - mObitsSent = true; + mObitsSent = 1; mLock.unlock(); ALOGV("Reporting death of proxy %p for %zu recipients\n", diff --git a/libs/binder/include/binder/BpBinder.h b/libs/binder/include/binder/BpBinder.h index 9e8102b25a..8e871b8214 100644 --- a/libs/binder/include/binder/BpBinder.h +++ b/libs/binder/include/binder/BpBinder.h @@ -133,12 +133,13 @@ private: bool isDescriptorCached() const; mutable Mutex mLock; - int32_t mTrackedUid; - volatile bool mAlive; - volatile bool mObitsSent; + volatile int32_t mAlive; + volatile int32_t mObitsSent; Vector<Obituary>* mObituaries; ObjectManager mObjects; + Parcel* mConstantData; mutable String16 mDescriptorCache; + int32_t mTrackedUid; static Mutex sTrackingLock; static std::unordered_map<int32_t,uint32_t> sTrackingMap; |