зеркало из https://github.com/mozilla/gecko-dev.git
Bug 917348 - Part 1: Make NS_IMPL_CYCLE_COLLECTING_AGGREGATED build on non-debug configurations; r=bsmedberg
--HG-- extra : rebase_source : 4984cf31e6855b721dabb27315b4255179aa586d
This commit is contained in:
Родитель
bc061b459a
Коммит
08499bf765
|
@ -143,8 +143,7 @@ _class::Internal::AddRef(void) \
|
|||
{ \
|
||||
_class* agg = NS_CYCLE_COLLECTION_CLASSNAME(_class)::Downcast(this); \
|
||||
MOZ_ASSERT(int32_t(agg->mRefCnt) >= 0, "illegal refcnt"); \
|
||||
NS_CheckThreadSafe(agg->_mOwningThread.GetThread(), \
|
||||
#_class " not thread-safe"); \
|
||||
NS_ASSERT_OWNINGTHREAD_AGGREGATE(agg, _class); \
|
||||
nsrefcnt count = agg->mRefCnt.incr(); \
|
||||
NS_LOG_ADDREF(this, count, #_class, sizeof(*agg)); \
|
||||
return count; \
|
||||
|
@ -154,8 +153,7 @@ _class::Internal::Release(void) \
|
|||
{ \
|
||||
_class* agg = NS_CYCLE_COLLECTION_CLASSNAME(_class)::Downcast(this); \
|
||||
MOZ_ASSERT(int32_t(agg->mRefCnt) > 0, "dup release"); \
|
||||
NS_CheckThreadSafe(agg->_mOwningThread.GetThread(), \
|
||||
#_class " not thread-safe"); \
|
||||
NS_ASSERT_OWNINGTHREAD_AGGREGATE(agg, _class); \
|
||||
nsrefcnt count = agg->mRefCnt.decr(this); \
|
||||
NS_LOG_RELEASE(this, count, #_class); \
|
||||
return count; \
|
||||
|
|
|
@ -61,11 +61,13 @@ private:
|
|||
};
|
||||
|
||||
#define NS_DECL_OWNINGTHREAD nsAutoOwningThread _mOwningThread;
|
||||
#define NS_ASSERT_OWNINGTHREAD(_class) \
|
||||
NS_CheckThreadSafe(_mOwningThread.GetThread(), #_class " not thread-safe")
|
||||
#define NS_ASSERT_OWNINGTHREAD_AGGREGATE(agg, _class) \
|
||||
NS_CheckThreadSafe(agg->_mOwningThread.GetThread(), #_class " not thread-safe")
|
||||
#define NS_ASSERT_OWNINGTHREAD(_class) NS_ASSERT_OWNINGTHREAD_AGGREGATE(this, _class)
|
||||
#else // !DEBUG && !NIGHTLY_BUILD
|
||||
|
||||
#define NS_DECL_OWNINGTHREAD /* nothing */
|
||||
#define NS_ASSERT_OWNINGTHREAD_AGGREGATE(agg, _class) ((void)0)
|
||||
#define NS_ASSERT_OWNINGTHREAD(_class) ((void)0)
|
||||
|
||||
#endif // DEBUG || NIGHTLY_BUILD
|
||||
|
|
Загрузка…
Ссылка в новой задаче