Count some classes for the leak stats. r=warren@netscape.com

git-svn-id: svn://10.0.0.236/trunk@69783 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
dbaron%fas.harvard.edu
2000-05-15 13:10:18 +00:00
parent 14aeb82131
commit d2082dfc31
2 changed files with 14 additions and 0 deletions

View File

@@ -160,12 +160,15 @@ nsCID_Destroy(nsHashKey *aKey, void *aData, void* closure);
// nsFactoryEntry
////////////////////////////////////////////////////////////////////////////////
MOZ_DECL_CTOR_COUNTER(nsFactoryEntry)
nsFactoryEntry::nsFactoryEntry(const nsCID &aClass,
const char *aLocation,
const char *aType,
nsIComponentLoader *aLoader)
: cid(aClass), factory(nsnull), loader(aLoader)
{
MOZ_COUNT_CTOR(nsFactoryEntry);
loader = aLoader;
type = aType;
location = aLocation;
@@ -175,11 +178,13 @@ nsFactoryEntry::nsFactoryEntry(const nsCID &aClass, nsIFactory *aFactory)
: cid(aClass), loader(nsnull)
{
MOZ_COUNT_CTOR(nsFactoryEntry);
factory = aFactory;
}
nsFactoryEntry::~nsFactoryEntry(void)
{
MOZ_COUNT_DTOR(nsFactoryEntry);
factory = 0;
loader = 0;
}

View File

@@ -102,17 +102,25 @@ static PRIntn PR_CALLBACK _hashEnumerate(PLHashEntry *he, PRIntn i, void *arg)
//
// HashKey
//
MOZ_DECL_CTOR_COUNTER(nsHashKey)
nsHashKey::nsHashKey(void)
{
MOZ_COUNT_CTOR(nsHashKey);
}
nsHashKey::~nsHashKey(void)
{
MOZ_COUNT_DTOR(nsHashKey);
}
MOZ_DECL_CTOR_COUNTER(nsHashtable)
nsHashtable::nsHashtable(PRUint32 aInitSize, PRBool threadSafe)
: mLock(NULL)
{
MOZ_COUNT_CTOR(nsHashtable);
hashtable = PL_NewHashTable(aInitSize,
_hashValue,
_hashKeyCompare,
@@ -132,6 +140,7 @@ nsHashtable::nsHashtable(PRUint32 aInitSize, PRBool threadSafe)
}
nsHashtable::~nsHashtable() {
MOZ_COUNT_DTOR(nsHashtable);
PL_HashTableDestroy(hashtable);
if (mLock) PR_DestroyLock(mLock);
}