Count various classes in leak/bloat logs. r=waterson@netscape.com

This commit is contained in:
dbaron%fas.harvard.edu 2000-06-15 02:18:32 +00:00
parent dd0c6672be
commit 5695245ccb
5 changed files with 33 additions and 0 deletions

View File

@ -24,6 +24,7 @@
#include "xptiprivate.h"
MOZ_DECL_CTOR_COUNTER(xptiFile);
xptiFile::xptiFile()
: mSize(),
@ -32,6 +33,7 @@ xptiFile::xptiFile()
mGuts(nsnull)
{
// empty
MOZ_COUNT_CTOR(xptiFile);
}
xptiFile::xptiFile(const nsInt64& aSize,
@ -50,6 +52,8 @@ xptiFile::xptiFile(const nsInt64& aSize,
if(aHeader)
SetHeader(aHeader);
MOZ_COUNT_CTOR(xptiFile);
}
xptiFile::xptiFile(const xptiFile& r, xptiWorkingSet* aWorkingSet,
@ -64,12 +68,16 @@ xptiFile::xptiFile(const xptiFile& r, xptiWorkingSet* aWorkingSet,
if(cloneGuts && r.mGuts)
mGuts = r.mGuts->Clone();
MOZ_COUNT_CTOR(xptiFile);
}
xptiFile::~xptiFile()
{
if(mGuts)
delete mGuts;
MOZ_COUNT_DTOR(xptiFile);
}
PRBool

View File

@ -54,10 +54,14 @@ xptiFileType::Type xptiFileType::GetType(const char* name)
/***************************************************************************/
MOZ_DECL_CTOR_COUNTER(xptiAutoLog);
xptiAutoLog::xptiAutoLog(xptiInterfaceInfoManager* mgr,
nsILocalFile* logfile, PRBool append)
: mMgr(nsnull), mOldFileDesc(nsnull)
{
MOZ_COUNT_CTOR(xptiAutoLog);
if(mgr && logfile)
{
PRFileDesc* fd;
@ -87,6 +91,8 @@ xptiAutoLog::xptiAutoLog(xptiInterfaceInfoManager* mgr,
xptiAutoLog::~xptiAutoLog()
{
MOZ_COUNT_DTOR(xptiAutoLog);
if(mMgr)
{
PRFileDesc* fd = mMgr->SetOpenLogFile(mOldFileDesc);

View File

@ -24,10 +24,14 @@
#include "xptiprivate.h"
MOZ_DECL_CTOR_COUNTER(xptiTypelibGuts);
xptiTypelibGuts::xptiTypelibGuts(XPTHeader* aHeader)
: mHeader(aHeader),
mInfoArray(nsnull)
{
MOZ_COUNT_CTOR(xptiTypelibGuts);
NS_ASSERTION(mHeader, "bad param");
if(mHeader->num_interfaces)
@ -42,6 +46,8 @@ xptiTypelibGuts::xptiTypelibGuts(XPTHeader* aHeader)
xptiTypelibGuts::~xptiTypelibGuts()
{
MOZ_COUNT_DTOR(xptiTypelibGuts);
if(mHeader && mInfoArray)
for(PRUint16 i = 0; i < GetInfoCount(); ++i)
NS_IF_RELEASE(mInfoArray[i]);

View File

@ -40,6 +40,8 @@ xpti_CompareIIDs(const void *v1, const void *v2)
return (PRIntn) ((const nsID*)v1)->Equals(*((const nsID*)v2));
}
MOZ_DECL_CTOR_COUNTER(xptiWorkingSet);
xptiWorkingSet::xptiWorkingSet()
: mFileCount(0),
mMaxFileCount(0),
@ -60,6 +62,7 @@ xptiWorkingSet::xptiWorkingSet()
mFileMergeOffsetMap(nsnull),
mZipItemMergeOffsetMap(nsnull)
{
MOZ_COUNT_CTOR(xptiWorkingSet);
// do nothing else...
}
@ -135,6 +138,8 @@ xptiWorkingSet::ClearZipItems()
xptiWorkingSet::~xptiWorkingSet()
{
MOZ_COUNT_DTOR(xptiWorkingSet);
ClearFiles();
ClearZipItems();
ClearHashTables();

View File

@ -24,11 +24,13 @@
#include "xptiprivate.h"
MOZ_DECL_CTOR_COUNTER(xptiZipItem);
xptiZipItem::xptiZipItem()
: mName(nsnull),
mGuts(nsnull)
{
MOZ_COUNT_CTOR(xptiZipItem);
// empty
}
@ -39,6 +41,8 @@ xptiZipItem::xptiZipItem(const char* aName,
: mName(aName),
mGuts(nsnull)
{
MOZ_COUNT_CTOR(xptiZipItem);
NS_ASSERTION(aWorkingSet,"bad param");
mName = XPT_STRDUP(aWorkingSet->GetStringArena(), aName);
@ -51,6 +55,8 @@ xptiZipItem::xptiZipItem(const xptiZipItem& r, xptiWorkingSet* aWorkingSet,
: mName(nsnull),
mGuts(nsnull)
{
MOZ_COUNT_CTOR(xptiZipItem);
NS_ASSERTION(aWorkingSet,"bad param");
mName = XPT_STRDUP(aWorkingSet->GetStringArena(), r.mName);
@ -60,6 +66,8 @@ xptiZipItem::xptiZipItem(const xptiZipItem& r, xptiWorkingSet* aWorkingSet,
xptiZipItem::~xptiZipItem()
{
MOZ_COUNT_DTOR(xptiZipItem);
if(mGuts)
delete mGuts;
}