Bug 1188745 - Rename nsTArray::SizeOfExcludingThis() as ShallowSizeOfExcludingThis(). r=froydnj.

This makes it clearer that, unlike how SizeOf*() functions usually work, this
doesn't measure any children hanging off the array.

And do likewise for nsTObserverArray.

--HG--
extra : rebase_source : 6a8c8d8ffb53ad51b5773afea77126cdd767f149
This commit is contained in:
Nicholas Nethercote 2015-07-28 23:24:24 -07:00
parent bdf2f8bda7
commit 87b80f8c66
84 changed files with 157 additions and 150 deletions

View File

@ -1928,7 +1928,7 @@ nsAttrValue::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
//n += container->mCSSStyleRule->SizeOfIncludingThis(aMallocSizeOf);
} else if (Type() == eAtomArray && container->mValue.mAtomArray) {
// Don't measure each nsIAtom, they are measured separatly.
n += container->mValue.mAtomArray->SizeOfIncludingThis(aMallocSizeOf);
n += container->mValue.mAtomArray->ShallowSizeOfIncludingThis(aMallocSizeOf);
}
break;
}

View File

@ -311,7 +311,8 @@ public:
size_t SizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const
{
return mallocSizeOf(this) + mTreeData.SizeOfExcludingThis(mallocSizeOf);
return mallocSizeOf(this) +
mTreeData.ShallowSizeOfExcludingThis(mallocSizeOf);
}
};
@ -624,7 +625,7 @@ size_t
WebGLElementArrayCache::SizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const
{
return mallocSizeOf(this) +
mBytes.SizeOfExcludingThis(mallocSizeOf) +
mBytes.ShallowSizeOfExcludingThis(mallocSizeOf) +
SizeOfNullable(mallocSizeOf, mUint8Tree) +
SizeOfNullable(mallocSizeOf, mUint16Tree) +
SizeOfNullable(mallocSizeOf, mUint32Tree);

View File

@ -1444,7 +1444,7 @@ size_t
EventListenerManager::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
{
size_t n = aMallocSizeOf(this);
n += mListeners.SizeOfExcludingThis(aMallocSizeOf);
n += mListeners.ShallowSizeOfExcludingThis(aMallocSizeOf);
uint32_t count = mListeners.Length();
for (uint32_t i = 0; i < count; ++i) {
JSEventHandler* jsEventHandler =

View File

@ -28,9 +28,9 @@ public:
virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override
{
size_t amount = 0;
amount += mBuffers.SizeOfExcludingThis(aMallocSizeOf);
amount += mBuffers.ShallowSizeOfExcludingThis(aMallocSizeOf);
for (size_t i = 0; i < mBuffers.Length(); i++) {
amount += mBuffers[i].SizeOfExcludingThis(aMallocSizeOf);
amount += mBuffers[i].ShallowSizeOfExcludingThis(aMallocSizeOf);
}
return amount;
@ -176,7 +176,7 @@ struct AudioChunk {
}
// Memory in the array is owned by mBuffer.
amount += mChannelData.SizeOfExcludingThis(aMallocSizeOf);
amount += mChannelData.ShallowSizeOfExcludingThis(aMallocSizeOf);
return amount;
}

View File

@ -167,7 +167,7 @@ AudioStream::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
// - mLatencyLog
// - mCubebStream
amount += mInserts.SizeOfExcludingThis(aMallocSizeOf);
amount += mInserts.ShallowSizeOfExcludingThis(aMallocSizeOf);
amount += mBuffer.SizeOfExcludingThis(aMallocSizeOf);
return amount;

View File

@ -391,7 +391,7 @@ size_t MediaCacheStream::SizeOfExcludingThis(
// Looks like these are not owned:
// - mClient
// - mPrincipal
size_t size = mBlocks.SizeOfExcludingThis(aMallocSizeOf);
size_t size = mBlocks.ShallowSizeOfExcludingThis(aMallocSizeOf);
size += mReadaheadBlocks.SizeOfExcludingThis(aMallocSizeOf);
size += mMetadataBlocks.SizeOfExcludingThis(aMallocSizeOf);
size += mPlayedBlocks.SizeOfExcludingThis(aMallocSizeOf);

View File

@ -581,7 +581,7 @@ MediaRawData::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
{
size_t size = aMallocSizeOf(this);
size += mBuffer->SizeOfIncludingThis(aMallocSizeOf);
size += mBuffer->ShallowSizeOfIncludingThis(aMallocSizeOf);
return size;
}

View File

@ -291,7 +291,7 @@ public:
virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override
{
size_t amount = mChunks.SizeOfExcludingThis(aMallocSizeOf);
size_t amount = mChunks.ShallowSizeOfExcludingThis(aMallocSizeOf);
for (size_t i = 0; i < mChunks.Length(); i++) {
amount += mChunks[i].SizeOfExcludingThisIfUnshared(aMallocSizeOf);
}

View File

@ -1950,15 +1950,15 @@ MediaStream::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
// - mAudioOutputStream - elements
amount += mBuffer.SizeOfExcludingThis(aMallocSizeOf);
amount += mAudioOutputs.SizeOfExcludingThis(aMallocSizeOf);
amount += mVideoOutputs.SizeOfExcludingThis(aMallocSizeOf);
amount += mAudioOutputs.ShallowSizeOfExcludingThis(aMallocSizeOf);
amount += mVideoOutputs.ShallowSizeOfExcludingThis(aMallocSizeOf);
amount += mExplicitBlockerCount.SizeOfExcludingThis(aMallocSizeOf);
amount += mListeners.SizeOfExcludingThis(aMallocSizeOf);
amount += mMainThreadListeners.SizeOfExcludingThis(aMallocSizeOf);
amount += mDisabledTrackIDs.SizeOfExcludingThis(aMallocSizeOf);
amount += mListeners.ShallowSizeOfExcludingThis(aMallocSizeOf);
amount += mMainThreadListeners.ShallowSizeOfExcludingThis(aMallocSizeOf);
amount += mDisabledTrackIDs.ShallowSizeOfExcludingThis(aMallocSizeOf);
amount += mBlocked.SizeOfExcludingThis(aMallocSizeOf);
amount += mGraphUpdateIndices.SizeOfExcludingThis(aMallocSizeOf);
amount += mConsumers.SizeOfExcludingThis(aMallocSizeOf);
amount += mConsumers.ShallowSizeOfExcludingThis(aMallocSizeOf);
return amount;
}

View File

@ -1199,7 +1199,7 @@ public:
size_t amount = MediaStream::SizeOfExcludingThis(aMallocSizeOf);
// Not owned:
// - mInputs elements
amount += mInputs.SizeOfExcludingThis(aMallocSizeOf);
amount += mInputs.ShallowSizeOfExcludingThis(aMallocSizeOf);
return amount;
}

View File

@ -546,7 +546,7 @@ size_t
RtspMediaResource::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
{
size_t size = BaseMediaResource::SizeOfExcludingThis(aMallocSizeOf);
size += mTrackBuffer.SizeOfExcludingThis(aMallocSizeOf);
size += mTrackBuffer.ShallowSizeOfExcludingThis(aMallocSizeOf);
// Include the size of each track buffer.
for (size_t i = 0; i < mTrackBuffer.Length(); i++) {

View File

@ -177,7 +177,7 @@ public:
size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
{
size_t amount = 0;
amount += mTracks.SizeOfExcludingThis(aMallocSizeOf);
amount += mTracks.ShallowSizeOfExcludingThis(aMallocSizeOf);
for (size_t i = 0; i < mTracks.Length(); i++) {
amount += mTracks[i]->SizeOfIncludingThis(aMallocSizeOf);
}

View File

@ -217,7 +217,7 @@ public:
size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
{
return mChanges.SizeOfExcludingThis(aMallocSizeOf);
return mChanges.ShallowSizeOfExcludingThis(aMallocSizeOf);
}
private:

View File

@ -202,7 +202,7 @@ MediaEncoder::GetEncodedData(nsTArray<nsTArray<uint8_t> >* aOutputBufs,
rv = mWriter->GetContainerData(aOutputBufs,
ContainerWriter::GET_HEADER);
if (aOutputBufs != nullptr) {
mSizeOfBuffer = aOutputBufs->SizeOfExcludingThis(MallocSizeOf);
mSizeOfBuffer = aOutputBufs->ShallowSizeOfExcludingThis(MallocSizeOf);
}
if (NS_FAILED(rv)) {
LOG(LogLevel::Error,("Error! writer fail to generate header!"));
@ -237,7 +237,7 @@ MediaEncoder::GetEncodedData(nsTArray<nsTArray<uint8_t> >* aOutputBufs,
isAudioCompleted && isVideoCompleted ?
ContainerWriter::FLUSH_NEEDED : 0);
if (aOutputBufs != nullptr) {
mSizeOfBuffer = aOutputBufs->SizeOfExcludingThis(MallocSizeOf);
mSizeOfBuffer = aOutputBufs->ShallowSizeOfExcludingThis(MallocSizeOf);
}
if (NS_SUCCEEDED(rv)) {
// Successfully get the copy of final container data from writer.

View File

@ -34,7 +34,7 @@ ResourceItem::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
size_t size = aMallocSizeOf(this);
// size excluding this
size += mData->SizeOfExcludingThis(aMallocSizeOf);
size += mData->ShallowSizeOfExcludingThis(aMallocSizeOf);
return size;
}

View File

@ -101,8 +101,8 @@ AnalyserNode::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
{
size_t amount = AudioNode::SizeOfExcludingThis(aMallocSizeOf);
amount += mAnalysisBlock.SizeOfExcludingThis(aMallocSizeOf);
amount += mChunks.SizeOfExcludingThis(aMallocSizeOf);
amount += mOutputBuffer.SizeOfExcludingThis(aMallocSizeOf);
amount += mChunks.ShallowSizeOfExcludingThis(aMallocSizeOf);
amount += mOutputBuffer.ShallowSizeOfExcludingThis(aMallocSizeOf);
return amount;
}

View File

@ -260,7 +260,7 @@ size_t
AudioBuffer::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
{
size_t amount = aMallocSizeOf(this);
amount += mJSChannels.SizeOfExcludingThis(aMallocSizeOf);
amount += mJSChannels.ShallowSizeOfExcludingThis(aMallocSizeOf);
if (mSharedChannels) {
amount += mSharedChannels->SizeOfIncludingThis(aMallocSizeOf);
}

View File

@ -1036,7 +1036,7 @@ AudioContext::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
if (mListener) {
amount += mListener->SizeOfIncludingThis(aMallocSizeOf);
}
amount += mDecodeJobs.SizeOfExcludingThis(aMallocSizeOf);
amount += mDecodeJobs.ShallowSizeOfExcludingThis(aMallocSizeOf);
for (uint32_t i = 0; i < mDecodeJobs.Length(); ++i) {
amount += mDecodeJobs[i]->SizeOfIncludingThis(aMallocSizeOf);
}

View File

@ -186,7 +186,7 @@ public:
virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override
{
size_t amount = AudioNodeEngine::SizeOfExcludingThis(aMallocSizeOf);
amount += mInputChannels.SizeOfExcludingThis(aMallocSizeOf);
amount += mInputChannels.ShallowSizeOfExcludingThis(aMallocSizeOf);
return amount;
}

View File

@ -122,7 +122,7 @@ AudioListener::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
{
size_t amount = aMallocSizeOf(this);
// AudioNodes are tracked separately
amount += mPanners.SizeOfExcludingThis(aMallocSizeOf);
amount += mPanners.ShallowSizeOfExcludingThis(aMallocSizeOf);
return amount;
}

View File

@ -97,16 +97,16 @@ AudioNode::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
// - mStream
size_t amount = 0;
amount += mInputNodes.SizeOfExcludingThis(aMallocSizeOf);
amount += mInputNodes.ShallowSizeOfExcludingThis(aMallocSizeOf);
for (size_t i = 0; i < mInputNodes.Length(); i++) {
amount += mInputNodes[i].SizeOfExcludingThis(aMallocSizeOf);
}
// Just measure the array. The entire audio node graph is measured via the
// MediaStreamGraph's streams, so we don't want to double-count the elements.
amount += mOutputNodes.SizeOfExcludingThis(aMallocSizeOf);
amount += mOutputNodes.ShallowSizeOfExcludingThis(aMallocSizeOf);
amount += mOutputParams.SizeOfExcludingThis(aMallocSizeOf);
amount += mOutputParams.ShallowSizeOfExcludingThis(aMallocSizeOf);
for (size_t i = 0; i < mOutputParams.Length(); i++) {
amount += mOutputParams[i]->SizeOfIncludingThis(aMallocSizeOf);
}

View File

@ -96,7 +96,7 @@ public:
virtual size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const override
{
size_t amount = ThreadSharedObject::SizeOfExcludingThis(aMallocSizeOf);
amount += mContents.SizeOfExcludingThis(aMallocSizeOf);
amount += mContents.ShallowSizeOfExcludingThis(aMallocSizeOf);
for (size_t i = 0; i < mContents.Length(); i++) {
amount += mContents[i].SizeOfExcludingThis(aMallocSizeOf);
}

View File

@ -62,7 +62,7 @@ AudioNodeStream::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
// - mEngine
amount += ProcessedMediaStream::SizeOfExcludingThis(aMallocSizeOf);
amount += mLastChunks.SizeOfExcludingThis(aMallocSizeOf);
amount += mLastChunks.ShallowSizeOfExcludingThis(aMallocSizeOf);
for (size_t i = 0; i < mLastChunks.Length(); i++) {
// NB: This is currently unshared only as there are instances of
// double reporting in DMD otherwise.

View File

@ -169,7 +169,7 @@ public:
// - mNode
// Just count the array, actual nodes are counted in mNode.
amount += mInputNodes.SizeOfExcludingThis(aMallocSizeOf);
amount += mInputNodes.ShallowSizeOfExcludingThis(aMallocSizeOf);
if (mNodeStreamPort) {
amount += mNodeStreamPort->SizeOfIncludingThis(aMallocSizeOf);

View File

@ -218,7 +218,7 @@ public:
// - mDestination - probably not owned
// - AudioParamTimelines - counted in the AudioNode
size_t amount = AudioNodeEngine::SizeOfExcludingThis(aMallocSizeOf);
amount += mBiquads.SizeOfExcludingThis(aMallocSizeOf);
amount += mBiquads.ShallowSizeOfExcludingThis(aMallocSizeOf);
return amount;
}

View File

@ -16,12 +16,12 @@ size_t
DelayBuffer::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
{
size_t amount = 0;
amount += mChunks.SizeOfExcludingThis(aMallocSizeOf);
amount += mChunks.ShallowSizeOfExcludingThis(aMallocSizeOf);
for (size_t i = 0; i < mChunks.Length(); i++) {
amount += mChunks[i].SizeOfExcludingThis(aMallocSizeOf, false);
}
amount += mUpmixChannels.SizeOfExcludingThis(aMallocSizeOf);
amount += mUpmixChannels.ShallowSizeOfExcludingThis(aMallocSizeOf);
return amount;
}

View File

@ -232,7 +232,7 @@ public:
amount += aMallocSizeOf(mKissFFT);
amount += aMallocSizeOf(mKissIFFT);
#endif
amount += mOutputBuffer.SizeOfExcludingThis(aMallocSizeOf);
amount += mOutputBuffer.ShallowSizeOfExcludingThis(aMallocSizeOf);
return amount;
}

View File

@ -614,7 +614,7 @@ WebAudioDecodeJob::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
if (mOutput) {
amount += mOutput->SizeOfIncludingThis(aMallocSizeOf);
}
amount += mChannelBuffers.SizeOfExcludingThis(aMallocSizeOf);
amount += mChannelBuffers.ShallowSizeOfExcludingThis(aMallocSizeOf);
for (uint32_t i = 0; i < mChannelBuffers.Length(); ++i) {
amount += mChannelBuffers[i].SizeOfExcludingThis(aMallocSizeOf);
}

View File

@ -257,7 +257,7 @@ size_t
PannerNode::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
{
size_t amount = AudioNode::SizeOfExcludingThis(aMallocSizeOf);
amount += mSources.SizeOfExcludingThis(aMallocSizeOf);
amount += mSources.ShallowSizeOfExcludingThis(aMallocSizeOf);
return amount;
}

View File

@ -321,7 +321,7 @@ public:
// - mDestination (probably)
size_t amount = AudioNodeEngine::SizeOfExcludingThis(aMallocSizeOf);
amount += mSharedBuffers->SizeOfIncludingThis(aMallocSizeOf);
amount += mInputChannels.SizeOfExcludingThis(aMallocSizeOf);
amount += mInputChannels.ShallowSizeOfExcludingThis(aMallocSizeOf);
for (size_t i = 0; i < mInputChannels.Length(); i++) {
amount += mInputChannels[i].SizeOfExcludingThis(aMallocSizeOf);
}

View File

@ -135,7 +135,7 @@ public:
// Future: properly measure speex memory
amount += aMallocSizeOf(mUpSampler);
amount += aMallocSizeOf(mDownSampler);
amount += mBuffer.SizeOfExcludingThis(aMallocSizeOf);
amount += mBuffer.ShallowSizeOfExcludingThis(aMallocSizeOf);
return amount;
}
@ -261,7 +261,7 @@ public:
virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override
{
size_t amount = AudioNodeEngine::SizeOfExcludingThis(aMallocSizeOf);
amount += mCurve.SizeOfExcludingThis(aMallocSizeOf);
amount += mCurve.ShallowSizeOfExcludingThis(aMallocSizeOf);
amount += mResampler.SizeOfExcludingThis(aMallocSizeOf);
return amount;
}

View File

@ -45,7 +45,7 @@ public:
size_t sizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
{
size_t amount = aMallocSizeOf(this);
amount += m_buffer.SizeOfExcludingThis(aMallocSizeOf);
amount += m_buffer.ShallowSizeOfExcludingThis(aMallocSizeOf);
return amount;
}

View File

@ -55,14 +55,14 @@ DynamicsCompressor::DynamicsCompressor(float sampleRate, unsigned numberOfChanne
size_t DynamicsCompressor::sizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
{
size_t amount = aMallocSizeOf(this);
amount += m_preFilterPacks.SizeOfExcludingThis(aMallocSizeOf);
amount += m_preFilterPacks.ShallowSizeOfExcludingThis(aMallocSizeOf);
for (size_t i = 0; i < m_preFilterPacks.Length(); i++) {
if (m_preFilterPacks[i]) {
amount += m_preFilterPacks[i]->sizeOfIncludingThis(aMallocSizeOf);
}
}
amount += m_postFilterPacks.SizeOfExcludingThis(aMallocSizeOf);
amount += m_postFilterPacks.ShallowSizeOfExcludingThis(aMallocSizeOf);
for (size_t i = 0; i < m_postFilterPacks.Length(); i++) {
if (m_postFilterPacks[i]) {
amount += m_postFilterPacks[i]->sizeOfIncludingThis(aMallocSizeOf);

View File

@ -76,7 +76,7 @@ DynamicsCompressorKernel::DynamicsCompressorKernel(float sampleRate, unsigned nu
size_t DynamicsCompressorKernel::sizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
{
size_t amount = 0;
amount += m_preDelayBuffers.SizeOfExcludingThis(aMallocSizeOf);
amount += m_preDelayBuffers.ShallowSizeOfExcludingThis(aMallocSizeOf);
for (size_t i = 0; i < m_preDelayBuffers.Length(); i++) {
amount += m_preDelayBuffers[i].SizeOfExcludingThis(aMallocSizeOf);
}

View File

@ -49,9 +49,9 @@ size_t FFTConvolver::sizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) co
{
size_t amount = 0;
amount += m_frame.SizeOfExcludingThis(aMallocSizeOf);
amount += m_inputBuffer.SizeOfExcludingThis(aMallocSizeOf);
amount += m_outputBuffer.SizeOfExcludingThis(aMallocSizeOf);
amount += m_lastOverlapBuffer.SizeOfExcludingThis(aMallocSizeOf);
amount += m_inputBuffer.ShallowSizeOfExcludingThis(aMallocSizeOf);
amount += m_outputBuffer.ShallowSizeOfExcludingThis(aMallocSizeOf);
amount += m_lastOverlapBuffer.ShallowSizeOfExcludingThis(aMallocSizeOf);
return amount;
}

View File

@ -82,7 +82,7 @@ HRTFDatabase::HRTFDatabase(float sampleRate)
size_t HRTFDatabase::sizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
{
size_t amount = aMallocSizeOf(this);
amount += m_elevations.SizeOfExcludingThis(aMallocSizeOf);
amount += m_elevations.ShallowSizeOfExcludingThis(aMallocSizeOf);
for (size_t i = 0; i < m_elevations.Length(); i++) {
amount += m_elevations[i]->sizeOfIncludingThis(aMallocSizeOf);
}

View File

@ -54,7 +54,7 @@ size_t HRTFElevation::sizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) c
{
size_t amount = aMallocSizeOf(this);
amount += m_kernelListL.SizeOfExcludingThis(aMallocSizeOf);
amount += m_kernelListL.ShallowSizeOfExcludingThis(aMallocSizeOf);
for (size_t i = 0; i < m_kernelListL.Length(); i++) {
amount += m_kernelListL[i]->sizeOfIncludingThis(aMallocSizeOf);
}

View File

@ -80,10 +80,10 @@ size_t HRTFPanner::sizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) cons
amount += m_convolverL2.sizeOfExcludingThis(aMallocSizeOf);
amount += m_convolverR2.sizeOfExcludingThis(aMallocSizeOf);
amount += m_delayLine.SizeOfExcludingThis(aMallocSizeOf);
amount += m_tempL1.SizeOfExcludingThis(aMallocSizeOf);
amount += m_tempL2.SizeOfExcludingThis(aMallocSizeOf);
amount += m_tempR1.SizeOfExcludingThis(aMallocSizeOf);
amount += m_tempR2.SizeOfExcludingThis(aMallocSizeOf);
amount += m_tempL1.ShallowSizeOfExcludingThis(aMallocSizeOf);
amount += m_tempL2.ShallowSizeOfExcludingThis(aMallocSizeOf);
amount += m_tempR1.ShallowSizeOfExcludingThis(aMallocSizeOf);
amount += m_tempR2.ShallowSizeOfExcludingThis(aMallocSizeOf);
return amount;
}

View File

@ -109,10 +109,10 @@ size_t PeriodicWave::sizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) co
{
size_t amount = aMallocSizeOf(this);
amount += m_bandLimitedTables.SizeOfExcludingThis(aMallocSizeOf);
amount += m_bandLimitedTables.ShallowSizeOfExcludingThis(aMallocSizeOf);
for (size_t i = 0; i < m_bandLimitedTables.Length(); i++) {
if (m_bandLimitedTables[i]) {
amount += m_bandLimitedTables[i]->SizeOfIncludingThis(aMallocSizeOf);
amount += m_bandLimitedTables[i]->ShallowSizeOfIncludingThis(aMallocSizeOf);
}
}

View File

@ -108,7 +108,7 @@ Reverb::Reverb(ThreadSharedFloatArrayBufferList* impulseResponse, size_t impulse
size_t Reverb::sizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
{
size_t amount = aMallocSizeOf(this);
amount += m_convolvers.SizeOfExcludingThis(aMallocSizeOf);
amount += m_convolvers.ShallowSizeOfExcludingThis(aMallocSizeOf);
for (size_t i = 0; i < m_convolvers.Length(); i++) {
if (m_convolvers[i]) {
amount += m_convolvers[i]->sizeOfIncludingThis(aMallocSizeOf);

View File

@ -61,7 +61,7 @@ public:
size_t sizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
{
return m_buffer.SizeOfExcludingThis(aMallocSizeOf);
return m_buffer.ShallowSizeOfExcludingThis(aMallocSizeOf);
}
private:

View File

@ -154,14 +154,14 @@ ReverbConvolver::~ReverbConvolver()
size_t ReverbConvolver::sizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
{
size_t amount = aMallocSizeOf(this);
amount += m_stages.SizeOfExcludingThis(aMallocSizeOf);
amount += m_stages.ShallowSizeOfExcludingThis(aMallocSizeOf);
for (size_t i = 0; i < m_stages.Length(); i++) {
if (m_stages[i]) {
amount += m_stages[i]->sizeOfIncludingThis(aMallocSizeOf);
}
}
amount += m_backgroundStages.SizeOfExcludingThis(aMallocSizeOf);
amount += m_backgroundStages.ShallowSizeOfExcludingThis(aMallocSizeOf);
for (size_t i = 0; i < m_backgroundStages.Length(); i++) {
if (m_backgroundStages[i]) {
amount += m_backgroundStages[i]->sizeOfIncludingThis(aMallocSizeOf);

View File

@ -99,9 +99,9 @@ size_t ReverbConvolverStage::sizeOfIncludingThis(mozilla::MallocSizeOf aMallocSi
amount += m_fftConvolver->sizeOfIncludingThis(aMallocSizeOf);
}
amount += m_preDelayBuffer.SizeOfExcludingThis(aMallocSizeOf);
amount += m_temporaryBuffer.SizeOfExcludingThis(aMallocSizeOf);
amount += m_directKernel.SizeOfExcludingThis(aMallocSizeOf);
amount += m_preDelayBuffer.ShallowSizeOfExcludingThis(aMallocSizeOf);
amount += m_temporaryBuffer.ShallowSizeOfExcludingThis(aMallocSizeOf);
amount += m_directKernel.ShallowSizeOfExcludingThis(aMallocSizeOf);
if (m_directConvolver) {
amount += m_directConvolver->sizeOfIncludingThis(aMallocSizeOf);

View File

@ -57,7 +57,7 @@ public:
size_t sizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
{
return m_buffer.SizeOfExcludingThis(aMallocSizeOf);
return m_buffer.ShallowSizeOfExcludingThis(aMallocSizeOf);
}

View File

@ -861,7 +861,7 @@ SVGPathData::GetMarkerPositioningData(nsTArray<nsSVGMark> *aMarks) const
size_t
SVGPathData::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
{
return mData.SizeOfExcludingThis(aMallocSizeOf);
return mData.ShallowSizeOfExcludingThis(aMallocSizeOf);
}
size_t

View File

@ -1350,7 +1350,7 @@ gfxDWriteFontList::AddSizeOfExcludingThis(MallocSizeOf aMallocSizeOf,
aMallocSizeOf);
aSizes->mFontListSize +=
mNonExistingFonts.SizeOfExcludingThis(aMallocSizeOf);
mNonExistingFonts.ShallowSizeOfExcludingThis(aMallocSizeOf);
for (uint32_t i = 0; i < mNonExistingFonts.Length(); ++i) {
aSizes->mFontListSize +=
mNonExistingFonts[i].SizeOfExcludingThisIfUnshared(aMallocSizeOf);

View File

@ -1064,8 +1064,8 @@ protected:
size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) {
return aMallocSizeOf(this) +
mDetails.SizeOfExcludingThis(aMallocSizeOf) +
mOffsetToIndex.SizeOfExcludingThis(aMallocSizeOf);
mDetails.ShallowSizeOfExcludingThis(aMallocSizeOf) +
mOffsetToIndex.ShallowSizeOfExcludingThis(aMallocSizeOf);
}
private:

View File

@ -562,7 +562,7 @@ public:
}
size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const {
return mTableData.SizeOfExcludingThis(aMallocSizeOf);
return mTableData.ShallowSizeOfExcludingThis(aMallocSizeOf);
}
size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const {
return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
@ -1819,7 +1819,7 @@ gfxFontFamily::AddSizeOfExcludingThis(MallocSizeOf aMallocSizeOf,
mFamilyCharacterMap.SizeOfExcludingThis(aMallocSizeOf);
aSizes->mFontListSize +=
mAvailableFonts.SizeOfExcludingThis(aMallocSizeOf);
mAvailableFonts.ShallowSizeOfExcludingThis(aMallocSizeOf);
for (uint32_t i = 0; i < mAvailableFonts.Length(); ++i) {
gfxFontEntry *fe = mAvailableFonts[i];
if (fe) {

View File

@ -149,12 +149,12 @@ struct FontFamilyName final {
}
// memory reporting
size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const {
size_t SizeOfExcludingThis2(mozilla::MallocSizeOf aMallocSizeOf) const {
return mName.SizeOfExcludingThisIfUnshared(aMallocSizeOf);
}
size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const {
return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
size_t SizeOfIncludingThis2(mozilla::MallocSizeOf aMallocSizeOf) const {
return aMallocSizeOf(this) + SizeOfExcludingThis2(aMallocSizeOf);
}
FontFamilyType mType;
@ -337,7 +337,7 @@ public:
// memory reporting
size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const {
return mFontlist.SizeOfExcludingThis(aMallocSizeOf);
return mFontlist.ShallowSizeOfExcludingThis(aMallocSizeOf);
}
size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const {

View File

@ -245,7 +245,7 @@ public:
}
size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const {
size_t total = mBlocks.SizeOfExcludingThis(aMallocSizeOf);
size_t total = mBlocks.ShallowSizeOfExcludingThis(aMallocSizeOf);
for (uint32_t i = 0; i < mBlocks.Length(); i++) {
if (mBlocks[i]) {
total += aMallocSizeOf(mBlocks[i]);

View File

@ -883,7 +883,7 @@ gfxGDIFontList::AddSizeOfExcludingThis(MallocSizeOf aMallocSizeOf,
mFontSubstitutes.SizeOfExcludingThis(SizeOfFamilyNameEntryExcludingThis,
aMallocSizeOf);
aSizes->mFontListSize +=
mNonExistingFonts.SizeOfExcludingThis(aMallocSizeOf);
mNonExistingFonts.ShallowSizeOfExcludingThis(aMallocSizeOf);
for (uint32_t i = 0; i < mNonExistingFonts.Length(); ++i) {
aSizes->mFontListSize +=
mNonExistingFonts[i].SizeOfExcludingThisIfUnshared(aMallocSizeOf);

View File

@ -77,7 +77,7 @@ uint32_t
gfxGlyphExtents::GlyphWidths::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
{
uint32_t i;
uint32_t size = mBlocks.SizeOfExcludingThis(aMallocSizeOf);
uint32_t size = mBlocks.ShallowSizeOfExcludingThis(aMallocSizeOf);
for (i = 0; i < mBlocks.Length(); ++i) {
uintptr_t bits = mBlocks[i];
if (bits && !(bits & 0x1)) {

View File

@ -1088,7 +1088,7 @@ SizeOfPrefFontEntryExcludingThis
// again, we only care about the size of the array itself; we don't follow
// the refPtrs stored in it, because they point to entries already owned
// and accounted-for by the main font list
return aList.SizeOfExcludingThis(aMallocSizeOf);
return aList.ShallowSizeOfExcludingThis(aMallocSizeOf);
}
static size_t
@ -1130,7 +1130,7 @@ gfxPlatformFontList::AddSizeOfExcludingThis(MallocSizeOf aMallocSizeOf,
aSizes->mFontListSize +=
mCodepointsWithNoFonts.SizeOfExcludingThis(aMallocSizeOf);
aSizes->mFontListSize +=
mFontFamiliesToLoad.SizeOfExcludingThis(aMallocSizeOf);
mFontFamiliesToLoad.ShallowSizeOfExcludingThis(aMallocSizeOf);
aSizes->mFontListSize +=
mPrefFonts.SizeOfExcludingThis(SizeOfPrefFontEntryExcludingThis,

View File

@ -1487,7 +1487,7 @@ gfxTextRun::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf)
{
// The second arg is how much gfxTextRun::AllocateStorage would have
// allocated.
size_t total = mGlyphRuns.SizeOfExcludingThis(aMallocSizeOf);
size_t total = mGlyphRuns.ShallowSizeOfExcludingThis(aMallocSizeOf);
if (mDetailedGlyphs) {
total += mDetailedGlyphs->SizeOfIncludingThis(aMallocSizeOf);

View File

@ -397,7 +397,7 @@ SourceBuffer::SizeOfIncludingThisWithComputedFallback(MallocSizeOf
MutexAutoLock lock(mMutex);
size_t n = aMallocSizeOf(this);
n += mChunks.SizeOfExcludingThis(aMallocSizeOf);
n += mChunks.ShallowSizeOfExcludingThis(aMallocSizeOf);
for (uint32_t i = 0 ; i < mChunks.Length() ; ++i) {
size_t chunkSize = aMallocSizeOf(mChunks[i].Data());

View File

@ -159,7 +159,7 @@ protected:
// their types are opaque.
if (IsArray()) {
nsTArray<PropertyValue>* array = ToArray();
n += array->SizeOfExcludingThis(aMallocSizeOf);
n += array->ShallowSizeOfExcludingThis(aMallocSizeOf);
}
return n;
}

View File

@ -137,7 +137,7 @@ private:
{ return NS_PTR_TO_INT32(aKey); }
size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
{ return mEntries.SizeOfExcludingThis(aMallocSizeOf); }
{ return mEntries.ShallowSizeOfExcludingThis(aMallocSizeOf); }
enum { ALLOW_MEMMOVE = false };
};

View File

@ -86,8 +86,8 @@ size_t
nsTransformedTextRun::SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf)
{
size_t total = gfxTextRun::SizeOfExcludingThis(aMallocSizeOf);
total += mStyles.SizeOfExcludingThis(aMallocSizeOf);
total += mCapitalize.SizeOfExcludingThis(aMallocSizeOf);
total += mStyles.ShallowSizeOfExcludingThis(aMallocSizeOf);
total += mCapitalize.ShallowSizeOfExcludingThis(aMallocSizeOf);
if (mOwnsFactory) {
total += aMallocSizeOf(mFactory);
}

View File

@ -420,7 +420,7 @@ size_t
nsDocumentRuleResultCacheKey::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
{
size_t n = 0;
n += mMatchingRules.SizeOfExcludingThis(aMallocSizeOf);
n += mMatchingRules.ShallowSizeOfExcludingThis(aMallocSizeOf);
return n;
}

View File

@ -1392,7 +1392,7 @@ size_t
Declaration::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
{
size_t n = aMallocSizeOf(this);
n += mOrder.SizeOfExcludingThis(aMallocSizeOf);
n += mOrder.ShallowSizeOfExcludingThis(aMallocSizeOf);
n += mData ? mData ->SizeOfIncludingThis(aMallocSizeOf) : 0;
n += mImportantData ? mImportantData->SizeOfIncludingThis(aMallocSizeOf) : 0;
if (mVariables) {

View File

@ -2576,7 +2576,7 @@ Loader::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
if (mSheets) {
s += mSheets->mCompleteSheets.SizeOfExcludingThis(CountSheetMemory, aMallocSizeOf);
}
s += mObservers.SizeOfExcludingThis(aMallocSizeOf);
s += mObservers.ShallowSizeOfExcludingThis(aMallocSizeOf);
// Measurement of the following members may be added later if DMD finds it is
// worthwhile:

View File

@ -259,9 +259,9 @@ RuleProcessorCache::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf)
size_t n = aMallocSizeOf(this);
int count = 0;
n += mEntries.SizeOfExcludingThis(aMallocSizeOf);
n += mEntries.ShallowSizeOfExcludingThis(aMallocSizeOf);
for (Entry& e : mEntries) {
n += e.mDocumentEntries.SizeOfExcludingThis(aMallocSizeOf);
n += e.mDocumentEntries.ShallowSizeOfExcludingThis(aMallocSizeOf);
for (DocumentEntry& de : e.mDocumentEntries) {
count++;
n += de.mRuleProcessor->SizeOfIncludingThis(aMallocSizeOf);

View File

@ -749,7 +749,7 @@ static size_t
SizeOfRuleHashTableEntry(PLDHashEntryHdr* aHdr, MallocSizeOf aMallocSizeOf, void *)
{
RuleHashTableEntry* entry = static_cast<RuleHashTableEntry*>(aHdr);
return entry->mRules.SizeOfExcludingThis(aMallocSizeOf);
return entry->mRules.ShallowSizeOfExcludingThis(aMallocSizeOf);
}
size_t
@ -773,7 +773,7 @@ RuleHash::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
SizeOfRuleHashTableEntry,
aMallocSizeOf);
n += mUniversalRules.SizeOfExcludingThis(aMallocSizeOf);
n += mUniversalRules.ShallowSizeOfExcludingThis(aMallocSizeOf);
return n;
}
@ -926,7 +926,7 @@ static size_t
SizeOfSelectorsEntry(PLDHashEntryHdr* aHdr, MallocSizeOf aMallocSizeOf, void *)
{
AtomSelectorEntry* entry = static_cast<AtomSelectorEntry*>(aHdr);
return entry->mSelectors.SizeOfExcludingThis(aMallocSizeOf);
return entry->mSelectors.ShallowSizeOfExcludingThis(aMallocSizeOf);
}
static size_t
@ -956,15 +956,15 @@ RuleCascadeData::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
n += mPseudoElementRuleHashes[i]->SizeOfIncludingThis(aMallocSizeOf);
}
n += mStateSelectors.SizeOfExcludingThis(aMallocSizeOf);
n += mStateSelectors.ShallowSizeOfExcludingThis(aMallocSizeOf);
n += PL_DHashTableSizeOfExcludingThis(&mIdSelectors,
SizeOfSelectorsEntry, aMallocSizeOf);
n += PL_DHashTableSizeOfExcludingThis(&mClassSelectors,
SizeOfSelectorsEntry, aMallocSizeOf);
n += mPossiblyNegatedClassSelectors.SizeOfExcludingThis(aMallocSizeOf);
n += mPossiblyNegatedIDSelectors.SizeOfExcludingThis(aMallocSizeOf);
n += mPossiblyNegatedClassSelectors.ShallowSizeOfExcludingThis(aMallocSizeOf);
n += mPossiblyNegatedIDSelectors.ShallowSizeOfExcludingThis(aMallocSizeOf);
n += PL_DHashTableSizeOfExcludingThis(&mAttributeSelectors,
SizeOfSelectorsEntry, aMallocSizeOf);
@ -975,11 +975,11 @@ RuleCascadeData::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
SizeOfRuleHashTableEntry, aMallocSizeOf);
#endif
n += mFontFaceRules.SizeOfExcludingThis(aMallocSizeOf);
n += mKeyframesRules.SizeOfExcludingThis(aMallocSizeOf);
n += mFontFeatureValuesRules.SizeOfExcludingThis(aMallocSizeOf);
n += mPageRules.SizeOfExcludingThis(aMallocSizeOf);
n += mCounterStyleRules.SizeOfExcludingThis(aMallocSizeOf);
n += mFontFaceRules.ShallowSizeOfExcludingThis(aMallocSizeOf);
n += mKeyframesRules.ShallowSizeOfExcludingThis(aMallocSizeOf);
n += mFontFeatureValuesRules.ShallowSizeOfExcludingThis(aMallocSizeOf);
n += mPageRules.ShallowSizeOfExcludingThis(aMallocSizeOf);
n += mCounterStyleRules.ShallowSizeOfExcludingThis(aMallocSizeOf);
n += mKeyframesRuleTable.SizeOfExcludingThis(SizeOfKeyframesRuleEntryExcludingThis,
aMallocSizeOf,
nullptr);
@ -2906,7 +2906,7 @@ nsCSSRuleProcessor::CloneMQCacheKey()
nsCSSRuleProcessor::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
{
size_t n = 0;
n += mSheets.SizeOfExcludingThis(aMallocSizeOf);
n += mSheets.ShallowSizeOfExcludingThis(aMallocSizeOf);
for (RuleCascadeData* cascade = mRuleCascades; cascade;
cascade = cascade->mNext) {
n += cascade->SizeOfIncludingThis(aMallocSizeOf);

View File

@ -2525,7 +2525,7 @@ nsCSSValueGradient::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) con
n += mAngle.SizeOfExcludingThis(aMallocSizeOf);
n += mRadialValues[0].SizeOfExcludingThis(aMallocSizeOf);
n += mRadialValues[1].SizeOfExcludingThis(aMallocSizeOf);
n += mStops.SizeOfExcludingThis(aMallocSizeOf);
n += mStops.ShallowSizeOfExcludingThis(aMallocSizeOf);
for (uint32_t i = 0; i < mStops.Length(); i++) {
n += mStops[i].SizeOfExcludingThis(aMallocSizeOf);
}
@ -2685,7 +2685,7 @@ nsCSSCornerSizes::corners[4] = {
size_t
mozilla::css::GridTemplateAreasValue::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
{
size_t n = mNamedAreas.SizeOfExcludingThis(aMallocSizeOf);
n += mTemplates.SizeOfExcludingThis(aMallocSizeOf);
size_t n = mNamedAreas.ShallowSizeOfExcludingThis(aMallocSizeOf);
n += mTemplates.ShallowSizeOfExcludingThis(aMallocSizeOf);
return n;
}

View File

@ -226,10 +226,10 @@ nsStyleSet::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
for (uint32_t i = 0; i < mScopedDocSheetRuleProcessors.Length(); i++) {
n += mScopedDocSheetRuleProcessors[i]->SizeOfIncludingThis(aMallocSizeOf);
}
n += mScopedDocSheetRuleProcessors.SizeOfExcludingThis(aMallocSizeOf);
n += mScopedDocSheetRuleProcessors.ShallowSizeOfExcludingThis(aMallocSizeOf);
n += mRoots.SizeOfExcludingThis(aMallocSizeOf);
n += mOldRuleTrees.SizeOfExcludingThis(aMallocSizeOf);
n += mRoots.ShallowSizeOfExcludingThis(aMallocSizeOf);
n += mOldRuleTrees.ShallowSizeOfExcludingThis(aMallocSizeOf);
return n;
}

View File

@ -226,7 +226,7 @@ SizeOfObserverEntryExcludingThis(ValueObserverHashKey* aKey,
{
size_t n = 0;
n += aKey->mPrefName.SizeOfExcludingThisIfUnshared(aMallocSizeOf);
n += aData->mClosures.SizeOfExcludingThis(aMallocSizeOf);
n += aData->mClosures.ShallowSizeOfExcludingThis(aMallocSizeOf);
return n;
}
@ -244,7 +244,7 @@ Preferences::SizeOfIncludingThisAndOtherStuff(mozilla::MallocSizeOf aMallocSizeO
n += PL_DHashTableSizeOfExcludingThis(gHashTable, nullptr, aMallocSizeOf);
}
if (gCacheData) {
n += gCacheData->SizeOfIncludingThis(aMallocSizeOf);
n += gCacheData->ShallowSizeOfIncludingThis(aMallocSizeOf);
for (uint32_t i = 0, count = gCacheData->Length(); i < count; ++i) {
n += aMallocSizeOf((*gCacheData)[i]);
}

View File

@ -1667,7 +1667,7 @@ size_t CacheEntry::SizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const
size_t n = 0;
nsCOMPtr<nsISizeOf> sizeOf;
n += mCallbacks.SizeOfExcludingThis(mallocSizeOf);
n += mCallbacks.ShallowSizeOfExcludingThis(mallocSizeOf);
if (mFile) {
n += mFile->SizeOfIncludingThis(mallocSizeOf);
}

View File

@ -2009,7 +2009,7 @@ CacheFile::SizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const
}
// Input streams are not elsewhere reported.
n += mInputs.SizeOfExcludingThis(mallocSizeOf);
n += mInputs.ShallowSizeOfExcludingThis(mallocSizeOf);
for (uint32_t i = 0; i < mInputs.Length(); ++i) {
n += mInputs[i]->SizeOfIncludingThis(mallocSizeOf);
}
@ -2021,7 +2021,7 @@ CacheFile::SizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const
// The listeners are usually classes reported just above.
n += mChunkListeners.SizeOfExcludingThis(nullptr, mallocSizeOf);
n += mObjsToRelease.SizeOfExcludingThis(mallocSizeOf);
n += mObjsToRelease.ShallowSizeOfExcludingThis(mallocSizeOf);
// mHandle reported directly from CacheFileIOManager.

View File

@ -415,7 +415,7 @@ ValidityMap::Clear()
size_t
ValidityMap::SizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const
{
return mMap.SizeOfExcludingThis(mallocSizeOf);
return mMap.ShallowSizeOfExcludingThis(mallocSizeOf);
}
ValidityPair&

View File

@ -335,7 +335,7 @@ size_t CacheIOThread::SizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) co
size_t n = 0;
n += mallocSizeOf(mThread);
for (uint32_t level = 0; level < LAST_LEVEL; ++level) {
n += mEventQueue[level].SizeOfExcludingThis(mallocSizeOf);
n += mEventQueue[level].ShallowSizeOfExcludingThis(mallocSizeOf);
// Events referenced by the queues are arbitrary objects we cannot be sure
// are reported elsewhere as well as probably not implementing nsISizeOf
// interface. Deliberatly omitting them from reporting here.

View File

@ -3611,8 +3611,8 @@ CacheIndex::SizeOfExcludingThisInternal(mozilla::MallocSizeOf mallocSizeOf) cons
n += mTmpJournal.SizeOfExcludingThis(mallocSizeOf);
// mFrecencyArray items are reported by mIndex/mPendingUpdates
n += mFrecencyArray.SizeOfExcludingThis(mallocSizeOf);
n += mDiskConsumptionObservers.SizeOfExcludingThis(mallocSizeOf);
n += mFrecencyArray.ShallowSizeOfExcludingThis(mallocSizeOf);
n += mDiskConsumptionObservers.ShallowSizeOfExcludingThis(mallocSizeOf);
return n;
}

View File

@ -1970,10 +1970,10 @@ CacheStorageService::SizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) con
size_t n = 0;
// The elemets are referenced by sGlobalEntryTables and are reported from there
n += Pool(true).mFrecencyArray.SizeOfExcludingThis(mallocSizeOf);
n += Pool(true).mExpirationArray.SizeOfExcludingThis(mallocSizeOf);
n += Pool(false).mFrecencyArray.SizeOfExcludingThis(mallocSizeOf);
n += Pool(false).mExpirationArray.SizeOfExcludingThis(mallocSizeOf);
n += Pool(true).mFrecencyArray.ShallowSizeOfExcludingThis(mallocSizeOf);
n += Pool(true).mExpirationArray.ShallowSizeOfExcludingThis(mallocSizeOf);
n += Pool(false).mFrecencyArray.ShallowSizeOfExcludingThis(mallocSizeOf);
n += Pool(false).mExpirationArray.ShallowSizeOfExcludingThis(mallocSizeOf);
// Entries reported manually in CacheStorageService::CollectReports callback
if (sGlobalEntryTables) {
n += sGlobalEntryTables->SizeOfIncludingThis(nullptr, mallocSizeOf);

View File

@ -604,7 +604,7 @@ nsCookieEntry::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
{
size_t amount = nsCookieKey::SizeOfExcludingThis(aMallocSizeOf);
amount += mCookies.SizeOfExcludingThis(aMallocSizeOf);
amount += mCookies.ShallowSizeOfExcludingThis(aMallocSizeOf);
for (uint32_t i = 0; i < mCookies.Length(); ++i) {
amount += mCookies[i]->SizeOfIncludingThis(aMallocSizeOf);
}
@ -630,7 +630,7 @@ DBState::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
amount += aMallocSizeOf(this);
amount += hostTable.SizeOfExcludingThis(aMallocSizeOf);
amount += hostArray.SizeOfExcludingThis(aMallocSizeOf);
amount += hostArray.ShallowSizeOfExcludingThis(aMallocSizeOf);
for (uint32_t i = 0; i < hostArray.Length(); ++i) {
amount += hostArray[i].SizeOfExcludingThis(aMallocSizeOf);
}

View File

@ -347,7 +347,7 @@ nsHostRecord::SizeOfIncludingThis(MallocSizeOf mallocSizeOf) const
n += addr_info ? addr_info->SizeOfIncludingThis(mallocSizeOf) : 0;
n += mallocSizeOf(addr);
n += mBlacklistedItems.SizeOfExcludingThis(mallocSizeOf);
n += mBlacklistedItems.ShallowSizeOfExcludingThis(mallocSizeOf);
for (size_t i = 0; i < mBlacklistedItems.Length(); i++) {
n += mBlacklistedItems[i].SizeOfExcludingThisMustBeUnshared(mallocSizeOf);
}

View File

@ -383,7 +383,7 @@ StartupCache::HeapSizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf)
// DMD to be significant. They can be added later if necessary.
return aMallocSizeOf(this) +
mTable.SizeOfExcludingThis(SizeOfEntryExcludingThis, aMallocSizeOf) +
mPendingWrites.SizeOfExcludingThis(aMallocSizeOf);
mPendingWrites.ShallowSizeOfExcludingThis(aMallocSizeOf);
}
/* static */ size_t

View File

@ -181,7 +181,7 @@ private:
}
size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
{
return array.SizeOfExcludingThis(aMallocSizeOf);
return array.ShallowSizeOfExcludingThis(aMallocSizeOf);
}
ObserverArray array;
};

View File

@ -402,7 +402,7 @@ public:
size_t size;
size = mFileStats.SizeOfExcludingThis(SizeOfFileIOEntryTypeExcludingThis,
aMallocSizeOf) +
mSafeDirs.SizeOfExcludingThis(aMallocSizeOf);
mSafeDirs.ShallowSizeOfExcludingThis(aMallocSizeOf);
uint32_t safeDirsLen = mSafeDirs.Length();
for (uint32_t i = 0; i < safeDirsLen; ++i) {
size += mSafeDirs[i].SizeOfExcludingThis(aMallocSizeOf);

View File

@ -262,11 +262,11 @@ nsUrlClassifierPrefixSet::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeO
{
size_t n = 0;
n += aMallocSizeOf(this);
n += mIndexDeltas.SizeOfExcludingThis(aMallocSizeOf);
n += mIndexDeltas.ShallowSizeOfExcludingThis(aMallocSizeOf);
for (uint32_t i = 0; i < mIndexDeltas.Length(); i++) {
n += mIndexDeltas[i].SizeOfExcludingThis(aMallocSizeOf);
n += mIndexDeltas[i].ShallowSizeOfExcludingThis(aMallocSizeOf);
}
n += mIndexPrefixes.SizeOfExcludingThis(aMallocSizeOf);
n += mIndexPrefixes.ShallowSizeOfExcludingThis(aMallocSizeOf);
return n;
}

View File

@ -886,7 +886,7 @@ public:
// We don't measure what the WeakMappings point to, because the
// pointers are non-owning.
*aWeakMapsSize = mWeakMaps.SizeOfExcludingThis(aMallocSizeOf);
*aWeakMapsSize = mWeakMaps.ShallowSizeOfExcludingThis(aMallocSizeOf);
}
};

View File

@ -1857,15 +1857,15 @@ nsComponentManagerImpl::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf)
n += mContractIDs.SizeOfExcludingThis(SizeOfContractIDsEntryExcludingThis,
aMallocSizeOf);
n += sStaticModules->SizeOfIncludingThis(aMallocSizeOf);
n += sModuleLocations->SizeOfIncludingThis(aMallocSizeOf);
n += sStaticModules->ShallowSizeOfIncludingThis(aMallocSizeOf);
n += sModuleLocations->ShallowSizeOfIncludingThis(aMallocSizeOf);
n += mKnownStaticModules.SizeOfExcludingThis(aMallocSizeOf);
n += mKnownStaticModules.ShallowSizeOfExcludingThis(aMallocSizeOf);
n += mKnownModules.SizeOfExcludingThis(nullptr, aMallocSizeOf);
n += PL_SizeOfArenaPoolExcludingPool(&mArena, aMallocSizeOf);
n += mPendingServices.SizeOfExcludingThis(aMallocSizeOf);
n += mPendingServices.ShallowSizeOfExcludingThis(aMallocSizeOf);
// Measurement of the following members may be added later if DMD finds it is
// worthwhile:

View File

@ -97,8 +97,8 @@ private:
SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
{
size_t n = aMallocSizeOf(this);
n += mOrderedLT.SizeOfExcludingThis(aMallocSizeOf);
n += mExternalRefs.SizeOfExcludingThis(aMallocSizeOf);
n += mOrderedLT.ShallowSizeOfExcludingThis(aMallocSizeOf);
n += mExternalRefs.ShallowSizeOfExcludingThis(aMallocSizeOf);
return n;
}

View File

@ -297,7 +297,7 @@ nsCOMArray_base::SizeOfExcludingThis(
nsBaseArraySizeOfElementIncludingThisFunc aSizeOfElementIncludingThis,
mozilla::MallocSizeOf aMallocSizeOf, void* aData) const
{
size_t n = mArray.SizeOfExcludingThis(aMallocSizeOf);
size_t n = mArray.ShallowSizeOfExcludingThis(aMallocSizeOf);
if (aSizeOfElementIncludingThis) {
for (uint32_t index = 0; index < mArray.Length(); ++index) {

View File

@ -941,8 +941,10 @@ public:
}
// @return The amount of memory used by this nsTArray_Impl, excluding
// sizeof(*this).
size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
// sizeof(*this). If you want to measure anything hanging off the array, you
// must iterate over the elements and measure them individually; hence the
// "Shallow" prefix.
size_t ShallowSizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
{
if (this->UsesAutoArrayBuffer() || Hdr() == EmptyHdr()) {
return 0;
@ -951,10 +953,12 @@ public:
}
// @return The amount of memory used by this nsTArray_Impl, including
// sizeof(*this).
size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
// sizeof(*this). If you want to measure anything hanging off the array, you
// must iterate over the elements and measure them individually; hence the
// "Shallow" prefix.
size_t ShallowSizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
{
return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
return aMallocSizeOf(this) + ShallowSizeOfExcludingThis(aMallocSizeOf);
}
//

View File

@ -261,10 +261,12 @@ public:
void Compact() { mArray.Compact(); }
// Returns the number of bytes on the heap taken up by this object, not
// including sizeof(*this).
size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
// including sizeof(*this). If you want to measure anything hanging off the
// array, you must iterate over the elements and measure them individually;
// hence the "Shallow" prefix.
size_t ShallowSizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
{
return mArray.SizeOfExcludingThis(aMallocSizeOf);
return mArray.ShallowSizeOfExcludingThis(aMallocSizeOf);
}
//