Open Bug 749370 (CleanupCC) Opened 8 years ago Updated 4 years ago
[meta] Cycle collector cleanups
There is a lot of code in the cycle collector and associated callbacks that isn't used any more.
Adding bjacob's heroic TRAVERSE/UNLINK cleanups and various related bugs.
Is the iteration in <https://hg.mozilla.org/integration/mozilla-inbound/file/d7841347b558/dom/file/ArchiveReader.cpp#l227> something we can improve on?
I think it can just be replaced with NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mRequests).
Generally, anything like nsTArray<nsRefPtr<SomeCycleCollectedClass>> that just iterates over the array and does NoteXPCOMChild or whatever can be turned into a single TRAVERSE now. Same with nsCOMPtr instead of nsRefPtr, obviously. There are a number of places with a case like nsTArray<SomeClass>, where SomeClass has a single ref counted field. In that case, you have to define ImplCycleCollectionTraverse for SomeClass. For example, see what I did for nsEventListenerManager in bug 814738. Then you can just do a single line TRAVERSE.
You need to log in before you can comment on or make changes to this bug.