Added SizeOf method

git-svn-id: svn://10.0.0.236/trunk@3380 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
kipp
1998-06-05 21:38:36 +00:00
parent 2fa39f82f5
commit bc4023da9b
18 changed files with 183 additions and 35 deletions

View File

@@ -24,7 +24,7 @@
#include "nsDebug.h"
#include "prprf.h"
#include "prdtoa.h"
#include "nsISizeOfHandler.h"
const PRInt32 kGrowthDelta = 8;
const PRInt32 kNotFound = -1;
@@ -116,6 +116,13 @@ nsString::~nsString()
mCapacity=mLength=0;
}
void
nsString::SizeOf(nsISizeOfHandler* aHandler) const
{
aHandler->Add(sizeof(*this));
aHandler->Add(mCapacity * sizeof(chartype));
}
/*-------------------------------------------------------
* This method gets called when the internal buffer needs
* to grow to a given size.
@@ -2029,6 +2036,15 @@ nsAutoString::~nsAutoString()
}
}
void
nsAutoString::SizeOf(nsISizeOfHandler* aHandler) const
{
aHandler->Add(sizeof(*this));
if (mStr != mBuf) {
aHandler->Add(mCapacity * sizeof(chartype));
}
}
/**-------------------------------------------------------
*