author | Andrew McCreight <continuation@gmail.com> |
Tue, 10 Sep 2013 08:56:36 -0700 | |
changeset 146439 | d722282fdc4dde056610a04cb4db82c16e018aac |
parent 146438 | 8ac551efe4e110a439212a70002807fa1b7e9bac |
child 146440 | a36c944c929ed44a0ca361743cab150eca1be7c6 |
push id | 25260 |
push user | ryanvm@gmail.com |
push date | Wed, 11 Sep 2013 00:29:30 +0000 |
treeherder | mozilla-central@f73bed2856a8 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | smaug |
bugs | 913881 |
milestone | 26.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/xpcom/base/nsCycleCollector.cpp +++ b/xpcom/base/nsCycleCollector.cpp @@ -602,16 +602,24 @@ struct GCGraph nsTArray<WeakMapping> mWeakMaps; uint32_t mRootCount; GCGraph() : mRootCount(0) { } ~GCGraph() { } + void Clear() + { + mNodes.Clear(); + mEdges.Clear(); + mWeakMaps.Clear(); + mRootCount = 0; + } + void SizeOfExcludingThis(MallocSizeOf aMallocSizeOf, size_t *aNodesSize, size_t *aEdgesSize) const { *aNodesSize = mNodes.SizeOfExcludingThis(aMallocSizeOf); *aEdgesSize = mEdges.SizeOfExcludingThis(aMallocSizeOf); // These fields are deliberately not measured: // - mWeakMaps entries, because the pointers are non-owning } @@ -984,24 +992,16 @@ private: void MarkRoots(GCGraphBuilder &aBuilder); void ScanRoots(); void ScanWeakMaps(); // returns whether anything was collected bool CollectWhite(nsICycleCollectorListener *aListener); void CleanupAfterCollection(); - - void ClearGraph() - { - mGraph.mNodes.Clear(); - mGraph.mEdges.Clear(); - mGraph.mWeakMaps.Clear(); - mGraph.mRootCount = 0; - } }; /** * GraphWalker is templatized over a Visitor class that must provide * the following two methods: * * bool ShouldVisitNode(PtrInfo const *pi); * void VisitNode(PtrInfo *pi); @@ -2610,17 +2610,17 @@ nsCycleCollector::PrepareForCollection(n timeLog.Checkpoint("PrepareForCollection()"); } void nsCycleCollector::CleanupAfterCollection() { mWhiteNodes->Clear(); mWhiteNodes = nullptr; - ClearGraph(); + mGraph.Clear(); mCollectionInProgress = false; #ifdef XP_OS2 // Now that the cycle collector has freed some memory, we can try to // force the C library to give back as much memory to the system as // possible. _heapmin(); #endif