This commit is contained in:
Johnny Stenback 2008-07-01 15:46:12 -07:00
Родитель e751f30b91
Коммит e5e3cac6ca
2 изменённых файлов: 22 добавлений и 3 удалений

Просмотреть файл

@ -319,10 +319,18 @@ public:
}
void AddRef() {
if (mRefCnt == PR_UINT16_MAX) {
NS_WARNING("refcount overflow, leaking nsCSSValue::Array");
return;
}
++mRefCnt;
NS_LOG_ADDREF(this, mRefCnt, "nsCSSValue::Array", sizeof(*this));
}
void Release() {
if (mRefCnt == PR_UINT16_MAX) {
NS_WARNING("refcount overflow, leaking nsCSSValue::Array");
return;
}
--mRefCnt;
NS_LOG_RELEASE(this, mRefCnt, "nsCSSValue::Array");
if (mRefCnt == 0)

Просмотреть файл

@ -157,11 +157,22 @@ public:
~Assertion();
void AddRef() { ++mRefCnt; }
void AddRef() {
if (mRefCnt == PR_UINT16_MAX) {
NS_WARNING("refcount overflow, leaking Assertion");
return;
}
++mRefCnt;
}
void Release(nsFixedSizeAllocator& aAllocator) {
if (mRefCnt == PR_UINT16_MAX) {
NS_WARNING("refcount overflow, leaking Assertion");
return;
}
if (--mRefCnt == 0)
Destroy(aAllocator, this); }
Destroy(aAllocator, this);
}
// For nsIRDFPurgeableDataSource
inline void Mark() { u.as.mMarked = PR_TRUE; }
@ -194,7 +205,7 @@ public:
// also shared between hash/as (see the union above)
// but placed after union definition to ensure that
// all 32-bit entries are long aligned
PRInt16 mRefCnt;
PRUint16 mRefCnt;
PRPackedBool mHashEntry;
private: