mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 712835 (part 1 of 3) - Add nsStringBuffer::SizeOfIncludingThisIfUnshared(). r=khuey.
--HG-- extra : rebase_source : 44f4e4139aaefb003f95df0d9fbec7e1c06e7a9f
This commit is contained in:
parent
c30eae6661
commit
e134d1c73e
@ -169,6 +169,11 @@ class nsStringBuffer
|
||||
bool aMoveOwnership = false);
|
||||
void ToString(PRUint32 len, nsACString &str,
|
||||
bool aMoveOwnership = false);
|
||||
|
||||
/**
|
||||
* This measures the size only if the StringBuffer is unshared.
|
||||
*/
|
||||
size_t SizeOfIncludingThisIfUnshared(nsMallocSizeOfFun aMallocSizeOf) const;
|
||||
};
|
||||
|
||||
#endif /* !defined(nsStringBuffer_h__ */
|
||||
|
@ -307,6 +307,16 @@ nsStringBuffer::ToString(PRUint32 len, nsACString &str,
|
||||
accessor->set(data, len, flags);
|
||||
}
|
||||
|
||||
size_t
|
||||
nsStringBuffer::SizeOfIncludingThisIfUnshared(nsMallocSizeOfFun aMallocSizeOf) const
|
||||
{
|
||||
if (!IsReadonly())
|
||||
{
|
||||
return aMallocSizeOf(this, sizeof(nsStringBuffer) + mStorageSize);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user