Added SizeOf method
git-svn-id: svn://10.0.0.236/trunk@3380 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**-------------------------------------------------------
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user