Merge "Optimize BpBinder struct size."

This commit is contained in:
Steven Moreland 2020-03-04 21:05:57 +00:00 committed by Gerrit Code Review
commit d6dad7afc0
2 changed files with 10 additions and 11 deletions

View file

@ -139,10 +139,10 @@ BpBinder* BpBinder::create(int32_t handle) {
BpBinder::BpBinder(int32_t handle, int32_t trackedUid)
: mHandle(handle)
, mStability(0)
, mAlive(1)
, mObitsSent(0)
, mObituaries(nullptr)
, mTrackedUid(trackedUid)
, mAlive(true)
, mObitsSent(false)
, mObituaries(nullptr)
{
ALOGV("Creating BpBinder %p handle %d\n", this, mHandle);
@ -185,7 +185,7 @@ const String16& BpBinder::getInterfaceDescriptor() const
bool BpBinder::isBinderAlive() const
{
return mAlive != 0;
return mAlive;
}
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 = 0;
if (status == DEAD_OBJECT) mAlive = false;
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 = 0;
mAlive = false;
if (mObitsSent) return;
mLock.lock();
@ -332,7 +332,7 @@ void BpBinder::sendObituary()
self->flushCommands();
mObituaries = nullptr;
}
mObitsSent = 1;
mObitsSent = true;
mLock.unlock();
ALOGV("Reporting death of proxy %p for %zu recipients\n",

View file

@ -133,13 +133,12 @@ private:
bool isDescriptorCached() const;
mutable Mutex mLock;
volatile int32_t mAlive;
volatile int32_t mObitsSent;
int32_t mTrackedUid;
volatile bool mAlive;
volatile bool 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;