summaryrefslogtreecommitdiff
path: root/libs/utils/RefBase.cpp
AgeCommit message (Collapse)Author
2012-03-07remove files that moved to frameworks/native Mathias Agopian
Change-Id: I140d291e520097b1148930f736823650e08488f7
2012-01-09Rename LOG_ASSERT to ALOG_ASSERT DO NOT MERGE Steve Block
See https://android-git.corp.google.com/g/157519 Bug: 5449033 Change-Id: I8ceb2dba1b031a0fd68d15d146960d9ced62bbf3
2012-01-08Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) DO NOT MERGE Steve Block
See https://android-git.corp.google.com/g/#/c/157220 Bug: 5449033 Change-Id: Ic9c19d30693bd56755f55906127cd6bd7126096c
2012-01-03Rename (IF_)LOGD(_IF) to (IF_)ALOGD(_IF) DO NOT MERGE Steve Block
See https://android-git.corp.google.com/g/156016 Bug: 5449033 Change-Id: I4c4e33bb9df3e39e11cd985e193e6fbab4635298
2011-10-26Rename (IF_)LOGV(_IF) to (IF_)ALOGV(_IF) DO NOT MERGE Steve Block
See https://android-git.corp.google.com/g/#/c/143865 Bug: 5449033 Change-Id: I0122812ed6ff6f5b59fe4a43ab8bff0577adde0a
2011-08-11fix a memory leak and memory corruption in RefBase Mathias Agopian
we would leak a weakref_impl if a RefBase was never incWeak()'ed. there was also a dangling pointer that would cause memory corruption and double-delete when a custom destroyer was used to delay the execution of ~RefBase. it turns out that the custom destroyer feature caused most of the problems, so it's now gone. The only client was SurfaceFlinger who now handles things on its own. RefBase is essentially back its "gingerbread" state, but the code was slightly cleaned-up. Bug: 5151207, 5084978 Change-Id: Id6ef1d707f96d96366f75068f77b30e0ce2722a5
2011-06-13fix RefBase so it retains binary-compatibility with gingerbread Mathias Agopian
Bug: 4595257 Change-Id: I0d5e10f497e3f39868bff58f6ded510c38b44b12
2011-06-08am b40e85f9: am 645434fb: Merge "Fix a leak in RefBase" into honeycomb-mr2 Mathias Agopian
* commit 'b40e85f90146a654bfe5657187be491147814ea0': Fix a leak in RefBase
2011-06-08Fix a leak in RefBase Mathias Agopian
this bug was introduced recently. it caused RefBase's weakref_impl structure to be leaked for every RefBase object (about 20 bytes). Change-Id: Id85e749ba04521199555dd701198edd097c313d4
2011-06-06merge various SF fixes from gingerbread to honeycomb-mr2 (DO NOT MERGE) Mathias Agopian
Fix a race that could cause GL commands to be executed from the wrong thread. RefBase subclasses can now decide how they want to be destroyed. Fix a race in SurfaceFlinger that could cause layers to be leaked forever. Fix a race-condtion in SurfaceFlinger that could lead to a crash. initial cherry-pick: resolved conflicts for merge of b9783b49 to honeycomb-plus-aosp Change-Id: I2a335e03fff219e35c18a7b0089b3a11d636576f
2011-06-06resolved conflicts for merge of b9783b49 to honeycomb-plus-aosp Marco Nelissen
Change-Id: I1d86ea56b3d1d1b69f6671e5b0df0ca3f0c79643
2011-05-24am c9cd2387: Merge changes I37f0f315,I8cbf6044,Ibb598931,I5262bf11 into ↵ Simon Wilson
gingerbread * commit 'c9cd2387b6938a6fbefc731d2177902266f2a130': Fix a race that could cause GL commands to be executed from the wrong thread. RefBase subclasses can now decide how they want to be destroyed. Fix a race in SurfaceFlinger that could cause layers to be leaked forever. Fix a race-condtion in SurfaceFlinger that could lead to a crash.
2011-05-23RefBase subclasses can now decide how they want to be destroyed. Mathias Agopian
This adds a destroy() virtual on RefBase which sublasses can implement. destroy() is called in lieu of the destructor whenthe last strong ref goes away. Bug: 4483050 Change-Id: I8cbf6044a6fd3f01043a45592b5a60fa1e5fade2
2011-04-26am bb93dad9: am bb10986c: am 13ce221e: Merge "libutils: Fix an improper ↵ Kenny Root
const-cast in RefBase" * commit 'bb93dad9250c0ee8330ab37bbdcd2eb8bfc0f930': libutils: Fix an improper const-cast in RefBase
2011-04-22libutils: Fix an improper const-cast in RefBase Josh Stone
Under Fedora 15 Beta, gcc 4.6.0 warns: frameworks/base/libs/utils/RefBase.cpp: In member function ‘void android::RefBase::weakref_type::trackMe(bool, bool)’: frameworks/base/libs/utils/RefBase.cpp:483:67: error: passing ‘const android::RefBase::weakref_impl’ as ‘this’ argument of ‘void android::RefBase::weakref_impl::trackMe(bool, bool)’ discards qualifiers [-fpermissive] trackMe is not a const function, so don't use const in the static_cast to a weakref_impl pointer. Change-Id: I3c9ba73eb127985f5f54197ffecf2939c50f632c
2011-02-25Fix sp<> conversion operator / constructor Mathias Agopian
some of the conversion operators were not using the proper pointer type when calling incStrong/decStrong, usually it has no bad consequences, but for some implementation of the ref-counted object it could lead to recording the wrong owner id. Change-Id: If574b9069b8a4cf6e0911a992c8f095aba799995
2011-02-23Fix some issues with RefBase debugging. Mathias Agopian
First slipt sp<> out of RefBase into StrongPointer.h so it can be reused more easily and to make it clear that it doesn't require RefBase. Note: the rest of the change only affects the system when DEBUG_REFS is enabled. The main problem we fix here is that the owner id associated with each reference could get out of date when a sp<> or wp<> was moved, for instance when they're used in a Vector< >. We fix this issue by calling into RefBase::moveReferences from a template specialization for sp<TYPE> and wp<TYPE> of the type helpers. RefBase::moveReferences() has then a chance to update the owner ids. There is a little bit of trickery to implement this generically in RefBase, where we need to use a templatized functor that can turn a sp<TYPE>* casted to a void* into a RefBase*. Introduced a new debug option DEBUG_REFS_FATAL_SANITY_CHECKS currently set to 0 by default as there seem to be an issue with sp<ANativeWindow> which trips the sanity checks. Change-Id: I4825b21c8ec47d4a0ef35d760760ae0c9cdfbd7f
2011-02-22Remove RefBase.h dependency on TextOutput.h Mathias Agopian
Change-Id: I72cd6b98ef82b4868fe1c8ec87862cf43fb4ee73
2009-03-03auto import from //depot/cupcake/@135843 The Android Open Source Project
2009-03-03auto import from //depot/cupcake/@135843 The Android Open Source Project
2008-10-21Initial Contribution The Android Open Source Project