Loading libs/binder/IPCThreadState.cpp +9 −9 Original line number Original line Diff line number Diff line Loading @@ -692,7 +692,7 @@ status_t IPCThreadState::waitForResponse(Parcel *reply, status_t *acquireResult) case BR_ACQUIRE_RESULT: case BR_ACQUIRE_RESULT: { { LOG_ASSERT(acquireResult != NULL, "Unexpected brACQUIRE_RESULT"); ALOG_ASSERT(acquireResult != NULL, "Unexpected brACQUIRE_RESULT"); const int32_t result = mIn.readInt32(); const int32_t result = mIn.readInt32(); if (!acquireResult) continue; if (!acquireResult) continue; *acquireResult = result ? NO_ERROR : INVALID_OPERATION; *acquireResult = result ? NO_ERROR : INVALID_OPERATION; Loading @@ -703,7 +703,7 @@ status_t IPCThreadState::waitForResponse(Parcel *reply, status_t *acquireResult) { { binder_transaction_data tr; binder_transaction_data tr; err = mIn.read(&tr, sizeof(tr)); err = mIn.read(&tr, sizeof(tr)); LOG_ASSERT(err == NO_ERROR, "Not enough command data for brREPLY"); ALOG_ASSERT(err == NO_ERROR, "Not enough command data for brREPLY"); if (err != NO_ERROR) goto finish; if (err != NO_ERROR) goto finish; if (reply) { if (reply) { Loading Loading @@ -752,7 +752,7 @@ finish: status_t IPCThreadState::talkWithDriver(bool doReceive) status_t IPCThreadState::talkWithDriver(bool doReceive) { { LOG_ASSERT(mProcess->mDriverFD >= 0, "Binder driver is not opened"); ALOG_ASSERT(mProcess->mDriverFD >= 0, "Binder driver is not opened"); binder_write_read bwr; binder_write_read bwr; Loading Loading @@ -905,7 +905,7 @@ status_t IPCThreadState::executeCommand(int32_t cmd) case BR_ACQUIRE: case BR_ACQUIRE: refs = (RefBase::weakref_type*)mIn.readInt32(); refs = (RefBase::weakref_type*)mIn.readInt32(); obj = (BBinder*)mIn.readInt32(); obj = (BBinder*)mIn.readInt32(); LOG_ASSERT(refs->refBase() == obj, ALOG_ASSERT(refs->refBase() == obj, "BR_ACQUIRE: object %p does not match cookie %p (expected %p)", "BR_ACQUIRE: object %p does not match cookie %p (expected %p)", refs, obj, refs->refBase()); refs, obj, refs->refBase()); obj->incStrong(mProcess.get()); obj->incStrong(mProcess.get()); Loading @@ -921,7 +921,7 @@ status_t IPCThreadState::executeCommand(int32_t cmd) case BR_RELEASE: case BR_RELEASE: refs = (RefBase::weakref_type*)mIn.readInt32(); refs = (RefBase::weakref_type*)mIn.readInt32(); obj = (BBinder*)mIn.readInt32(); obj = (BBinder*)mIn.readInt32(); LOG_ASSERT(refs->refBase() == obj, ALOG_ASSERT(refs->refBase() == obj, "BR_RELEASE: object %p does not match cookie %p (expected %p)", "BR_RELEASE: object %p does not match cookie %p (expected %p)", refs, obj, refs->refBase()); refs, obj, refs->refBase()); IF_LOG_REMOTEREFS() { IF_LOG_REMOTEREFS() { Loading @@ -946,7 +946,7 @@ status_t IPCThreadState::executeCommand(int32_t cmd) // NOTE: This assertion is not valid, because the object may no // NOTE: This assertion is not valid, because the object may no // longer exist (thus the (BBinder*)cast above resulting in a different // longer exist (thus the (BBinder*)cast above resulting in a different // memory address). // memory address). //LOG_ASSERT(refs->refBase() == obj, //ALOG_ASSERT(refs->refBase() == obj, // "BR_DECREFS: object %p does not match cookie %p (expected %p)", // "BR_DECREFS: object %p does not match cookie %p (expected %p)", // refs, obj, refs->refBase()); // refs, obj, refs->refBase()); mPendingWeakDerefs.push(refs); mPendingWeakDerefs.push(refs); Loading @@ -958,7 +958,7 @@ status_t IPCThreadState::executeCommand(int32_t cmd) { { const bool success = refs->attemptIncStrong(mProcess.get()); const bool success = refs->attemptIncStrong(mProcess.get()); LOG_ASSERT(success && refs->refBase() == obj, ALOG_ASSERT(success && refs->refBase() == obj, "BR_ATTEMPT_ACQUIRE: object %p does not match cookie %p (expected %p)", "BR_ATTEMPT_ACQUIRE: object %p does not match cookie %p (expected %p)", refs, obj, refs->refBase()); refs, obj, refs->refBase()); Loading @@ -971,7 +971,7 @@ status_t IPCThreadState::executeCommand(int32_t cmd) { { binder_transaction_data tr; binder_transaction_data tr; result = mIn.read(&tr, sizeof(tr)); result = mIn.read(&tr, sizeof(tr)); LOG_ASSERT(result == NO_ERROR, ALOG_ASSERT(result == NO_ERROR, "Not enough command data for brTRANSACTION"); "Not enough command data for brTRANSACTION"); if (result != NO_ERROR) break; if (result != NO_ERROR) break; Loading Loading @@ -1114,7 +1114,7 @@ void IPCThreadState::freeBuffer(Parcel* parcel, const uint8_t* data, size_t data IF_LOG_COMMANDS() { IF_LOG_COMMANDS() { alog << "Writing BC_FREE_BUFFER for " << data << endl; alog << "Writing BC_FREE_BUFFER for " << data << endl; } } LOG_ASSERT(data != NULL, "Called with NULL data"); ALOG_ASSERT(data != NULL, "Called with NULL data"); if (parcel != NULL) parcel->closeFileDescriptors(); if (parcel != NULL) parcel->closeFileDescriptors(); IPCThreadState* state = self(); IPCThreadState* state = self(); state->mOut.writeInt32(BC_FREE_BUFFER); state->mOut.writeInt32(BC_FREE_BUFFER); Loading libs/utils/RefBase.cpp +7 −7 Original line number Original line Diff line number Diff line Loading @@ -332,7 +332,7 @@ void RefBase::incStrong(const void* id) const refs->addStrongRef(id); refs->addStrongRef(id); const int32_t c = android_atomic_inc(&refs->mStrong); const int32_t c = android_atomic_inc(&refs->mStrong); LOG_ASSERT(c > 0, "incStrong() called on %p after last strong ref", refs); ALOG_ASSERT(c > 0, "incStrong() called on %p after last strong ref", refs); #if PRINT_REFS #if PRINT_REFS ALOGD("incStrong of %p from %p: cnt=%d\n", this, id, c); ALOGD("incStrong of %p from %p: cnt=%d\n", this, id, c); #endif #endif Loading @@ -352,7 +352,7 @@ void RefBase::decStrong(const void* id) const #if PRINT_REFS #if PRINT_REFS ALOGD("decStrong of %p from %p: cnt=%d\n", this, id, c); ALOGD("decStrong of %p from %p: cnt=%d\n", this, id, c); #endif #endif LOG_ASSERT(c >= 1, "decStrong() called on %p too many times", refs); ALOG_ASSERT(c >= 1, "decStrong() called on %p too many times", refs); if (c == 1) { if (c == 1) { refs->mBase->onLastStrongRef(id); refs->mBase->onLastStrongRef(id); if ((refs->mFlags&OBJECT_LIFETIME_MASK) == OBJECT_LIFETIME_STRONG) { if ((refs->mFlags&OBJECT_LIFETIME_MASK) == OBJECT_LIFETIME_STRONG) { Loading @@ -369,7 +369,7 @@ void RefBase::forceIncStrong(const void* id) const refs->addStrongRef(id); refs->addStrongRef(id); const int32_t c = android_atomic_inc(&refs->mStrong); const int32_t c = android_atomic_inc(&refs->mStrong); LOG_ASSERT(c >= 0, "forceIncStrong called on %p after ref count underflow", ALOG_ASSERT(c >= 0, "forceIncStrong called on %p after ref count underflow", refs); refs); #if PRINT_REFS #if PRINT_REFS ALOGD("forceIncStrong of %p from %p: cnt=%d\n", this, id, c); ALOGD("forceIncStrong of %p from %p: cnt=%d\n", this, id, c); Loading Loading @@ -399,7 +399,7 @@ void RefBase::weakref_type::incWeak(const void* id) weakref_impl* const impl = static_cast<weakref_impl*>(this); weakref_impl* const impl = static_cast<weakref_impl*>(this); impl->addWeakRef(id); impl->addWeakRef(id); const int32_t c = android_atomic_inc(&impl->mWeak); const int32_t c = android_atomic_inc(&impl->mWeak); LOG_ASSERT(c >= 0, "incWeak called on %p after last weak ref", this); ALOG_ASSERT(c >= 0, "incWeak called on %p after last weak ref", this); } } Loading @@ -408,7 +408,7 @@ void RefBase::weakref_type::decWeak(const void* id) weakref_impl* const impl = static_cast<weakref_impl*>(this); weakref_impl* const impl = static_cast<weakref_impl*>(this); impl->removeWeakRef(id); impl->removeWeakRef(id); const int32_t c = android_atomic_dec(&impl->mWeak); const int32_t c = android_atomic_dec(&impl->mWeak); LOG_ASSERT(c >= 1, "decWeak called on %p too many times", this); ALOG_ASSERT(c >= 1, "decWeak called on %p too many times", this); if (c != 1) return; if (c != 1) return; if ((impl->mFlags&OBJECT_LIFETIME_WEAK) == OBJECT_LIFETIME_STRONG) { if ((impl->mFlags&OBJECT_LIFETIME_WEAK) == OBJECT_LIFETIME_STRONG) { Loading Loading @@ -442,7 +442,7 @@ bool RefBase::weakref_type::attemptIncStrong(const void* id) weakref_impl* const impl = static_cast<weakref_impl*>(this); weakref_impl* const impl = static_cast<weakref_impl*>(this); int32_t curCount = impl->mStrong; int32_t curCount = impl->mStrong; LOG_ASSERT(curCount >= 0, "attemptIncStrong called on %p after underflow", ALOG_ASSERT(curCount >= 0, "attemptIncStrong called on %p after underflow", this); this); while (curCount > 0 && curCount != INITIAL_STRONG_VALUE) { while (curCount > 0 && curCount != INITIAL_STRONG_VALUE) { if (android_atomic_cmpxchg(curCount, curCount+1, &impl->mStrong) == 0) { if (android_atomic_cmpxchg(curCount, curCount+1, &impl->mStrong) == 0) { Loading Loading @@ -503,7 +503,7 @@ bool RefBase::weakref_type::attemptIncWeak(const void* id) weakref_impl* const impl = static_cast<weakref_impl*>(this); weakref_impl* const impl = static_cast<weakref_impl*>(this); int32_t curCount = impl->mWeak; int32_t curCount = impl->mWeak; LOG_ASSERT(curCount >= 0, "attemptIncWeak called on %p after underflow", ALOG_ASSERT(curCount >= 0, "attemptIncWeak called on %p after underflow", this); this); while (curCount > 0) { while (curCount > 0) { if (android_atomic_cmpxchg(curCount, curCount+1, &impl->mWeak) == 0) { if (android_atomic_cmpxchg(curCount, curCount+1, &impl->mWeak) == 0) { Loading libs/utils/String16.cpp +2 −2 Original line number Original line Diff line number Diff line Loading @@ -112,7 +112,7 @@ String16::String16(const char16_t* o) { { size_t len = strlen16(o); size_t len = strlen16(o); SharedBuffer* buf = SharedBuffer::alloc((len+1)*sizeof(char16_t)); SharedBuffer* buf = SharedBuffer::alloc((len+1)*sizeof(char16_t)); LOG_ASSERT(buf, "Unable to allocate shared buffer"); ALOG_ASSERT(buf, "Unable to allocate shared buffer"); if (buf) { if (buf) { char16_t* str = (char16_t*)buf->data(); char16_t* str = (char16_t*)buf->data(); strcpy16(str, o); strcpy16(str, o); Loading @@ -126,7 +126,7 @@ String16::String16(const char16_t* o) String16::String16(const char16_t* o, size_t len) String16::String16(const char16_t* o, size_t len) { { SharedBuffer* buf = SharedBuffer::alloc((len+1)*sizeof(char16_t)); SharedBuffer* buf = SharedBuffer::alloc((len+1)*sizeof(char16_t)); LOG_ASSERT(buf, "Unable to allocate shared buffer"); ALOG_ASSERT(buf, "Unable to allocate shared buffer"); if (buf) { if (buf) { char16_t* str = (char16_t*)buf->data(); char16_t* str = (char16_t*)buf->data(); memcpy(str, o, len*sizeof(char16_t)); memcpy(str, o, len*sizeof(char16_t)); Loading libs/utils/String8.cpp +3 −3 Original line number Original line Diff line number Diff line Loading @@ -80,7 +80,7 @@ static char* allocFromUTF8(const char* in, size_t len) { { if (len > 0) { if (len > 0) { SharedBuffer* buf = SharedBuffer::alloc(len+1); SharedBuffer* buf = SharedBuffer::alloc(len+1); LOG_ASSERT(buf, "Unable to allocate shared buffer"); ALOG_ASSERT(buf, "Unable to allocate shared buffer"); if (buf) { if (buf) { char* str = (char*)buf->data(); char* str = (char*)buf->data(); memcpy(str, in, len); memcpy(str, in, len); Loading @@ -103,7 +103,7 @@ static char* allocFromUTF16(const char16_t* in, size_t len) } } SharedBuffer* buf = SharedBuffer::alloc(bytes+1); SharedBuffer* buf = SharedBuffer::alloc(bytes+1); LOG_ASSERT(buf, "Unable to allocate shared buffer"); ALOG_ASSERT(buf, "Unable to allocate shared buffer"); if (!buf) { if (!buf) { return getEmptyString(); return getEmptyString(); } } Loading @@ -125,7 +125,7 @@ static char* allocFromUTF32(const char32_t* in, size_t len) } } SharedBuffer* buf = SharedBuffer::alloc(bytes+1); SharedBuffer* buf = SharedBuffer::alloc(bytes+1); LOG_ASSERT(buf, "Unable to allocate shared buffer"); ALOG_ASSERT(buf, "Unable to allocate shared buffer"); if (!buf) { if (!buf) { return getEmptyString(); return getEmptyString(); } } Loading libs/utils/VectorImpl.cpp +8 −8 Original line number Original line Diff line number Diff line Loading @@ -56,7 +56,7 @@ VectorImpl::VectorImpl(const VectorImpl& rhs) VectorImpl::~VectorImpl() VectorImpl::~VectorImpl() { { LOG_ASSERT(!mCount, ALOG_ASSERT(!mCount, "[%p] " "[%p] " "subclasses of VectorImpl must call finish_vector()" "subclasses of VectorImpl must call finish_vector()" " in their destructor. Leaking %d bytes.", " in their destructor. Leaking %d bytes.", Loading @@ -66,7 +66,7 @@ VectorImpl::~VectorImpl() VectorImpl& VectorImpl::operator = (const VectorImpl& rhs) VectorImpl& VectorImpl::operator = (const VectorImpl& rhs) { { LOG_ASSERT(mItemSize == rhs.mItemSize, ALOG_ASSERT(mItemSize == rhs.mItemSize, "Vector<> have different types (this=%p, rhs=%p)", this, &rhs); "Vector<> have different types (this=%p, rhs=%p)", this, &rhs); if (this != &rhs) { if (this != &rhs) { release_storage(); release_storage(); Loading Loading @@ -248,7 +248,7 @@ ssize_t VectorImpl::replaceAt(size_t index) ssize_t VectorImpl::replaceAt(const void* prototype, size_t index) ssize_t VectorImpl::replaceAt(const void* prototype, size_t index) { { LOG_ASSERT(index<size(), ALOG_ASSERT(index<size(), "[%p] replace: index=%d, size=%d", this, (int)index, (int)size()); "[%p] replace: index=%d, size=%d", this, (int)index, (int)size()); void* item = editItemLocation(index); void* item = editItemLocation(index); Loading @@ -267,7 +267,7 @@ ssize_t VectorImpl::replaceAt(const void* prototype, size_t index) ssize_t VectorImpl::removeItemsAt(size_t index, size_t count) ssize_t VectorImpl::removeItemsAt(size_t index, size_t count) { { LOG_ASSERT((index+count)<=size(), ALOG_ASSERT((index+count)<=size(), "[%p] remove: index=%d, count=%d, size=%d", "[%p] remove: index=%d, count=%d, size=%d", this, (int)index, (int)count, (int)size()); this, (int)index, (int)count, (int)size()); Loading @@ -291,7 +291,7 @@ void VectorImpl::clear() void* VectorImpl::editItemLocation(size_t index) void* VectorImpl::editItemLocation(size_t index) { { LOG_ASSERT(index<capacity(), ALOG_ASSERT(index<capacity(), "[%p] editItemLocation: index=%d, capacity=%d, count=%d", "[%p] editItemLocation: index=%d, capacity=%d, count=%d", this, (int)index, (int)capacity(), (int)mCount); this, (int)index, (int)capacity(), (int)mCount); Loading @@ -303,7 +303,7 @@ void* VectorImpl::editItemLocation(size_t index) const void* VectorImpl::itemLocation(size_t index) const const void* VectorImpl::itemLocation(size_t index) const { { LOG_ASSERT(index<capacity(), ALOG_ASSERT(index<capacity(), "[%p] itemLocation: index=%d, capacity=%d, count=%d", "[%p] itemLocation: index=%d, capacity=%d, count=%d", this, (int)index, (int)capacity(), (int)mCount); this, (int)index, (int)capacity(), (int)mCount); Loading Loading @@ -349,7 +349,7 @@ void* VectorImpl::_grow(size_t where, size_t amount) // ALOGV("_grow(this=%p, where=%d, amount=%d) count=%d, capacity=%d", // ALOGV("_grow(this=%p, where=%d, amount=%d) count=%d, capacity=%d", // this, (int)where, (int)amount, (int)mCount, (int)capacity()); // this, (int)where, (int)amount, (int)mCount, (int)capacity()); LOG_ASSERT(where <= mCount, ALOG_ASSERT(where <= mCount, "[%p] _grow: where=%d, amount=%d, count=%d", "[%p] _grow: where=%d, amount=%d, count=%d", this, (int)where, (int)amount, (int)mCount); // caller already checked this, (int)where, (int)amount, (int)mCount); // caller already checked Loading Loading @@ -402,7 +402,7 @@ void VectorImpl::_shrink(size_t where, size_t amount) // ALOGV("_shrink(this=%p, where=%d, amount=%d) count=%d, capacity=%d", // ALOGV("_shrink(this=%p, where=%d, amount=%d) count=%d, capacity=%d", // this, (int)where, (int)amount, (int)mCount, (int)capacity()); // this, (int)where, (int)amount, (int)mCount, (int)capacity()); LOG_ASSERT(where + amount <= mCount, ALOG_ASSERT(where + amount <= mCount, "[%p] _shrink: where=%d, amount=%d, count=%d", "[%p] _shrink: where=%d, amount=%d, count=%d", this, (int)where, (int)amount, (int)mCount); // caller already checked this, (int)where, (int)amount, (int)mCount); // caller already checked Loading Loading
libs/binder/IPCThreadState.cpp +9 −9 Original line number Original line Diff line number Diff line Loading @@ -692,7 +692,7 @@ status_t IPCThreadState::waitForResponse(Parcel *reply, status_t *acquireResult) case BR_ACQUIRE_RESULT: case BR_ACQUIRE_RESULT: { { LOG_ASSERT(acquireResult != NULL, "Unexpected brACQUIRE_RESULT"); ALOG_ASSERT(acquireResult != NULL, "Unexpected brACQUIRE_RESULT"); const int32_t result = mIn.readInt32(); const int32_t result = mIn.readInt32(); if (!acquireResult) continue; if (!acquireResult) continue; *acquireResult = result ? NO_ERROR : INVALID_OPERATION; *acquireResult = result ? NO_ERROR : INVALID_OPERATION; Loading @@ -703,7 +703,7 @@ status_t IPCThreadState::waitForResponse(Parcel *reply, status_t *acquireResult) { { binder_transaction_data tr; binder_transaction_data tr; err = mIn.read(&tr, sizeof(tr)); err = mIn.read(&tr, sizeof(tr)); LOG_ASSERT(err == NO_ERROR, "Not enough command data for brREPLY"); ALOG_ASSERT(err == NO_ERROR, "Not enough command data for brREPLY"); if (err != NO_ERROR) goto finish; if (err != NO_ERROR) goto finish; if (reply) { if (reply) { Loading Loading @@ -752,7 +752,7 @@ finish: status_t IPCThreadState::talkWithDriver(bool doReceive) status_t IPCThreadState::talkWithDriver(bool doReceive) { { LOG_ASSERT(mProcess->mDriverFD >= 0, "Binder driver is not opened"); ALOG_ASSERT(mProcess->mDriverFD >= 0, "Binder driver is not opened"); binder_write_read bwr; binder_write_read bwr; Loading Loading @@ -905,7 +905,7 @@ status_t IPCThreadState::executeCommand(int32_t cmd) case BR_ACQUIRE: case BR_ACQUIRE: refs = (RefBase::weakref_type*)mIn.readInt32(); refs = (RefBase::weakref_type*)mIn.readInt32(); obj = (BBinder*)mIn.readInt32(); obj = (BBinder*)mIn.readInt32(); LOG_ASSERT(refs->refBase() == obj, ALOG_ASSERT(refs->refBase() == obj, "BR_ACQUIRE: object %p does not match cookie %p (expected %p)", "BR_ACQUIRE: object %p does not match cookie %p (expected %p)", refs, obj, refs->refBase()); refs, obj, refs->refBase()); obj->incStrong(mProcess.get()); obj->incStrong(mProcess.get()); Loading @@ -921,7 +921,7 @@ status_t IPCThreadState::executeCommand(int32_t cmd) case BR_RELEASE: case BR_RELEASE: refs = (RefBase::weakref_type*)mIn.readInt32(); refs = (RefBase::weakref_type*)mIn.readInt32(); obj = (BBinder*)mIn.readInt32(); obj = (BBinder*)mIn.readInt32(); LOG_ASSERT(refs->refBase() == obj, ALOG_ASSERT(refs->refBase() == obj, "BR_RELEASE: object %p does not match cookie %p (expected %p)", "BR_RELEASE: object %p does not match cookie %p (expected %p)", refs, obj, refs->refBase()); refs, obj, refs->refBase()); IF_LOG_REMOTEREFS() { IF_LOG_REMOTEREFS() { Loading @@ -946,7 +946,7 @@ status_t IPCThreadState::executeCommand(int32_t cmd) // NOTE: This assertion is not valid, because the object may no // NOTE: This assertion is not valid, because the object may no // longer exist (thus the (BBinder*)cast above resulting in a different // longer exist (thus the (BBinder*)cast above resulting in a different // memory address). // memory address). //LOG_ASSERT(refs->refBase() == obj, //ALOG_ASSERT(refs->refBase() == obj, // "BR_DECREFS: object %p does not match cookie %p (expected %p)", // "BR_DECREFS: object %p does not match cookie %p (expected %p)", // refs, obj, refs->refBase()); // refs, obj, refs->refBase()); mPendingWeakDerefs.push(refs); mPendingWeakDerefs.push(refs); Loading @@ -958,7 +958,7 @@ status_t IPCThreadState::executeCommand(int32_t cmd) { { const bool success = refs->attemptIncStrong(mProcess.get()); const bool success = refs->attemptIncStrong(mProcess.get()); LOG_ASSERT(success && refs->refBase() == obj, ALOG_ASSERT(success && refs->refBase() == obj, "BR_ATTEMPT_ACQUIRE: object %p does not match cookie %p (expected %p)", "BR_ATTEMPT_ACQUIRE: object %p does not match cookie %p (expected %p)", refs, obj, refs->refBase()); refs, obj, refs->refBase()); Loading @@ -971,7 +971,7 @@ status_t IPCThreadState::executeCommand(int32_t cmd) { { binder_transaction_data tr; binder_transaction_data tr; result = mIn.read(&tr, sizeof(tr)); result = mIn.read(&tr, sizeof(tr)); LOG_ASSERT(result == NO_ERROR, ALOG_ASSERT(result == NO_ERROR, "Not enough command data for brTRANSACTION"); "Not enough command data for brTRANSACTION"); if (result != NO_ERROR) break; if (result != NO_ERROR) break; Loading Loading @@ -1114,7 +1114,7 @@ void IPCThreadState::freeBuffer(Parcel* parcel, const uint8_t* data, size_t data IF_LOG_COMMANDS() { IF_LOG_COMMANDS() { alog << "Writing BC_FREE_BUFFER for " << data << endl; alog << "Writing BC_FREE_BUFFER for " << data << endl; } } LOG_ASSERT(data != NULL, "Called with NULL data"); ALOG_ASSERT(data != NULL, "Called with NULL data"); if (parcel != NULL) parcel->closeFileDescriptors(); if (parcel != NULL) parcel->closeFileDescriptors(); IPCThreadState* state = self(); IPCThreadState* state = self(); state->mOut.writeInt32(BC_FREE_BUFFER); state->mOut.writeInt32(BC_FREE_BUFFER); Loading
libs/utils/RefBase.cpp +7 −7 Original line number Original line Diff line number Diff line Loading @@ -332,7 +332,7 @@ void RefBase::incStrong(const void* id) const refs->addStrongRef(id); refs->addStrongRef(id); const int32_t c = android_atomic_inc(&refs->mStrong); const int32_t c = android_atomic_inc(&refs->mStrong); LOG_ASSERT(c > 0, "incStrong() called on %p after last strong ref", refs); ALOG_ASSERT(c > 0, "incStrong() called on %p after last strong ref", refs); #if PRINT_REFS #if PRINT_REFS ALOGD("incStrong of %p from %p: cnt=%d\n", this, id, c); ALOGD("incStrong of %p from %p: cnt=%d\n", this, id, c); #endif #endif Loading @@ -352,7 +352,7 @@ void RefBase::decStrong(const void* id) const #if PRINT_REFS #if PRINT_REFS ALOGD("decStrong of %p from %p: cnt=%d\n", this, id, c); ALOGD("decStrong of %p from %p: cnt=%d\n", this, id, c); #endif #endif LOG_ASSERT(c >= 1, "decStrong() called on %p too many times", refs); ALOG_ASSERT(c >= 1, "decStrong() called on %p too many times", refs); if (c == 1) { if (c == 1) { refs->mBase->onLastStrongRef(id); refs->mBase->onLastStrongRef(id); if ((refs->mFlags&OBJECT_LIFETIME_MASK) == OBJECT_LIFETIME_STRONG) { if ((refs->mFlags&OBJECT_LIFETIME_MASK) == OBJECT_LIFETIME_STRONG) { Loading @@ -369,7 +369,7 @@ void RefBase::forceIncStrong(const void* id) const refs->addStrongRef(id); refs->addStrongRef(id); const int32_t c = android_atomic_inc(&refs->mStrong); const int32_t c = android_atomic_inc(&refs->mStrong); LOG_ASSERT(c >= 0, "forceIncStrong called on %p after ref count underflow", ALOG_ASSERT(c >= 0, "forceIncStrong called on %p after ref count underflow", refs); refs); #if PRINT_REFS #if PRINT_REFS ALOGD("forceIncStrong of %p from %p: cnt=%d\n", this, id, c); ALOGD("forceIncStrong of %p from %p: cnt=%d\n", this, id, c); Loading Loading @@ -399,7 +399,7 @@ void RefBase::weakref_type::incWeak(const void* id) weakref_impl* const impl = static_cast<weakref_impl*>(this); weakref_impl* const impl = static_cast<weakref_impl*>(this); impl->addWeakRef(id); impl->addWeakRef(id); const int32_t c = android_atomic_inc(&impl->mWeak); const int32_t c = android_atomic_inc(&impl->mWeak); LOG_ASSERT(c >= 0, "incWeak called on %p after last weak ref", this); ALOG_ASSERT(c >= 0, "incWeak called on %p after last weak ref", this); } } Loading @@ -408,7 +408,7 @@ void RefBase::weakref_type::decWeak(const void* id) weakref_impl* const impl = static_cast<weakref_impl*>(this); weakref_impl* const impl = static_cast<weakref_impl*>(this); impl->removeWeakRef(id); impl->removeWeakRef(id); const int32_t c = android_atomic_dec(&impl->mWeak); const int32_t c = android_atomic_dec(&impl->mWeak); LOG_ASSERT(c >= 1, "decWeak called on %p too many times", this); ALOG_ASSERT(c >= 1, "decWeak called on %p too many times", this); if (c != 1) return; if (c != 1) return; if ((impl->mFlags&OBJECT_LIFETIME_WEAK) == OBJECT_LIFETIME_STRONG) { if ((impl->mFlags&OBJECT_LIFETIME_WEAK) == OBJECT_LIFETIME_STRONG) { Loading Loading @@ -442,7 +442,7 @@ bool RefBase::weakref_type::attemptIncStrong(const void* id) weakref_impl* const impl = static_cast<weakref_impl*>(this); weakref_impl* const impl = static_cast<weakref_impl*>(this); int32_t curCount = impl->mStrong; int32_t curCount = impl->mStrong; LOG_ASSERT(curCount >= 0, "attemptIncStrong called on %p after underflow", ALOG_ASSERT(curCount >= 0, "attemptIncStrong called on %p after underflow", this); this); while (curCount > 0 && curCount != INITIAL_STRONG_VALUE) { while (curCount > 0 && curCount != INITIAL_STRONG_VALUE) { if (android_atomic_cmpxchg(curCount, curCount+1, &impl->mStrong) == 0) { if (android_atomic_cmpxchg(curCount, curCount+1, &impl->mStrong) == 0) { Loading Loading @@ -503,7 +503,7 @@ bool RefBase::weakref_type::attemptIncWeak(const void* id) weakref_impl* const impl = static_cast<weakref_impl*>(this); weakref_impl* const impl = static_cast<weakref_impl*>(this); int32_t curCount = impl->mWeak; int32_t curCount = impl->mWeak; LOG_ASSERT(curCount >= 0, "attemptIncWeak called on %p after underflow", ALOG_ASSERT(curCount >= 0, "attemptIncWeak called on %p after underflow", this); this); while (curCount > 0) { while (curCount > 0) { if (android_atomic_cmpxchg(curCount, curCount+1, &impl->mWeak) == 0) { if (android_atomic_cmpxchg(curCount, curCount+1, &impl->mWeak) == 0) { Loading
libs/utils/String16.cpp +2 −2 Original line number Original line Diff line number Diff line Loading @@ -112,7 +112,7 @@ String16::String16(const char16_t* o) { { size_t len = strlen16(o); size_t len = strlen16(o); SharedBuffer* buf = SharedBuffer::alloc((len+1)*sizeof(char16_t)); SharedBuffer* buf = SharedBuffer::alloc((len+1)*sizeof(char16_t)); LOG_ASSERT(buf, "Unable to allocate shared buffer"); ALOG_ASSERT(buf, "Unable to allocate shared buffer"); if (buf) { if (buf) { char16_t* str = (char16_t*)buf->data(); char16_t* str = (char16_t*)buf->data(); strcpy16(str, o); strcpy16(str, o); Loading @@ -126,7 +126,7 @@ String16::String16(const char16_t* o) String16::String16(const char16_t* o, size_t len) String16::String16(const char16_t* o, size_t len) { { SharedBuffer* buf = SharedBuffer::alloc((len+1)*sizeof(char16_t)); SharedBuffer* buf = SharedBuffer::alloc((len+1)*sizeof(char16_t)); LOG_ASSERT(buf, "Unable to allocate shared buffer"); ALOG_ASSERT(buf, "Unable to allocate shared buffer"); if (buf) { if (buf) { char16_t* str = (char16_t*)buf->data(); char16_t* str = (char16_t*)buf->data(); memcpy(str, o, len*sizeof(char16_t)); memcpy(str, o, len*sizeof(char16_t)); Loading
libs/utils/String8.cpp +3 −3 Original line number Original line Diff line number Diff line Loading @@ -80,7 +80,7 @@ static char* allocFromUTF8(const char* in, size_t len) { { if (len > 0) { if (len > 0) { SharedBuffer* buf = SharedBuffer::alloc(len+1); SharedBuffer* buf = SharedBuffer::alloc(len+1); LOG_ASSERT(buf, "Unable to allocate shared buffer"); ALOG_ASSERT(buf, "Unable to allocate shared buffer"); if (buf) { if (buf) { char* str = (char*)buf->data(); char* str = (char*)buf->data(); memcpy(str, in, len); memcpy(str, in, len); Loading @@ -103,7 +103,7 @@ static char* allocFromUTF16(const char16_t* in, size_t len) } } SharedBuffer* buf = SharedBuffer::alloc(bytes+1); SharedBuffer* buf = SharedBuffer::alloc(bytes+1); LOG_ASSERT(buf, "Unable to allocate shared buffer"); ALOG_ASSERT(buf, "Unable to allocate shared buffer"); if (!buf) { if (!buf) { return getEmptyString(); return getEmptyString(); } } Loading @@ -125,7 +125,7 @@ static char* allocFromUTF32(const char32_t* in, size_t len) } } SharedBuffer* buf = SharedBuffer::alloc(bytes+1); SharedBuffer* buf = SharedBuffer::alloc(bytes+1); LOG_ASSERT(buf, "Unable to allocate shared buffer"); ALOG_ASSERT(buf, "Unable to allocate shared buffer"); if (!buf) { if (!buf) { return getEmptyString(); return getEmptyString(); } } Loading
libs/utils/VectorImpl.cpp +8 −8 Original line number Original line Diff line number Diff line Loading @@ -56,7 +56,7 @@ VectorImpl::VectorImpl(const VectorImpl& rhs) VectorImpl::~VectorImpl() VectorImpl::~VectorImpl() { { LOG_ASSERT(!mCount, ALOG_ASSERT(!mCount, "[%p] " "[%p] " "subclasses of VectorImpl must call finish_vector()" "subclasses of VectorImpl must call finish_vector()" " in their destructor. Leaking %d bytes.", " in their destructor. Leaking %d bytes.", Loading @@ -66,7 +66,7 @@ VectorImpl::~VectorImpl() VectorImpl& VectorImpl::operator = (const VectorImpl& rhs) VectorImpl& VectorImpl::operator = (const VectorImpl& rhs) { { LOG_ASSERT(mItemSize == rhs.mItemSize, ALOG_ASSERT(mItemSize == rhs.mItemSize, "Vector<> have different types (this=%p, rhs=%p)", this, &rhs); "Vector<> have different types (this=%p, rhs=%p)", this, &rhs); if (this != &rhs) { if (this != &rhs) { release_storage(); release_storage(); Loading Loading @@ -248,7 +248,7 @@ ssize_t VectorImpl::replaceAt(size_t index) ssize_t VectorImpl::replaceAt(const void* prototype, size_t index) ssize_t VectorImpl::replaceAt(const void* prototype, size_t index) { { LOG_ASSERT(index<size(), ALOG_ASSERT(index<size(), "[%p] replace: index=%d, size=%d", this, (int)index, (int)size()); "[%p] replace: index=%d, size=%d", this, (int)index, (int)size()); void* item = editItemLocation(index); void* item = editItemLocation(index); Loading @@ -267,7 +267,7 @@ ssize_t VectorImpl::replaceAt(const void* prototype, size_t index) ssize_t VectorImpl::removeItemsAt(size_t index, size_t count) ssize_t VectorImpl::removeItemsAt(size_t index, size_t count) { { LOG_ASSERT((index+count)<=size(), ALOG_ASSERT((index+count)<=size(), "[%p] remove: index=%d, count=%d, size=%d", "[%p] remove: index=%d, count=%d, size=%d", this, (int)index, (int)count, (int)size()); this, (int)index, (int)count, (int)size()); Loading @@ -291,7 +291,7 @@ void VectorImpl::clear() void* VectorImpl::editItemLocation(size_t index) void* VectorImpl::editItemLocation(size_t index) { { LOG_ASSERT(index<capacity(), ALOG_ASSERT(index<capacity(), "[%p] editItemLocation: index=%d, capacity=%d, count=%d", "[%p] editItemLocation: index=%d, capacity=%d, count=%d", this, (int)index, (int)capacity(), (int)mCount); this, (int)index, (int)capacity(), (int)mCount); Loading @@ -303,7 +303,7 @@ void* VectorImpl::editItemLocation(size_t index) const void* VectorImpl::itemLocation(size_t index) const const void* VectorImpl::itemLocation(size_t index) const { { LOG_ASSERT(index<capacity(), ALOG_ASSERT(index<capacity(), "[%p] itemLocation: index=%d, capacity=%d, count=%d", "[%p] itemLocation: index=%d, capacity=%d, count=%d", this, (int)index, (int)capacity(), (int)mCount); this, (int)index, (int)capacity(), (int)mCount); Loading Loading @@ -349,7 +349,7 @@ void* VectorImpl::_grow(size_t where, size_t amount) // ALOGV("_grow(this=%p, where=%d, amount=%d) count=%d, capacity=%d", // ALOGV("_grow(this=%p, where=%d, amount=%d) count=%d, capacity=%d", // this, (int)where, (int)amount, (int)mCount, (int)capacity()); // this, (int)where, (int)amount, (int)mCount, (int)capacity()); LOG_ASSERT(where <= mCount, ALOG_ASSERT(where <= mCount, "[%p] _grow: where=%d, amount=%d, count=%d", "[%p] _grow: where=%d, amount=%d, count=%d", this, (int)where, (int)amount, (int)mCount); // caller already checked this, (int)where, (int)amount, (int)mCount); // caller already checked Loading Loading @@ -402,7 +402,7 @@ void VectorImpl::_shrink(size_t where, size_t amount) // ALOGV("_shrink(this=%p, where=%d, amount=%d) count=%d, capacity=%d", // ALOGV("_shrink(this=%p, where=%d, amount=%d) count=%d, capacity=%d", // this, (int)where, (int)amount, (int)mCount, (int)capacity()); // this, (int)where, (int)amount, (int)mCount, (int)capacity()); LOG_ASSERT(where + amount <= mCount, ALOG_ASSERT(where + amount <= mCount, "[%p] _shrink: where=%d, amount=%d, count=%d", "[%p] _shrink: where=%d, amount=%d, count=%d", this, (int)where, (int)amount, (int)mCount); // caller already checked this, (int)where, (int)amount, (int)mCount); // caller already checked Loading