Closed Bug 913130 Opened 12 years ago Closed 12 years ago

Make ShutdownCollect() call Collect()

Categories

(Core :: XPCOM, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla26

People

(Reporter: mccr8, Assigned: mccr8)

References

(Blocks 1 open bug)

Details

Attachments

(4 files)

The body of the ShutdownCollect() loop is almost the same as Collect(), so we should just make them the same.
This is the most complicated part. Pass in white nodes as an argument, force a GC if the type is ShutdownCC, return if we collected anything. No particular hurry on the reviews for this.
Attachment #800830 - Flags: review?(bugs)
A few of the things in these two methods are different for no reason I can see, so make them consistent. I figure it is better to do PrepareForCollection as early as possible.
Attachment #800831 - Flags: review?(bugs)
PrepareForCollection just initializes some variables and calls the runtime's PrepareForCollection, so doing it repeatedly doesn't seem like a big deal. Doing CleanupAfterCollection on every iteration will fire telemetry repeatedly, but we don't run shutdown CCs in opt builds so it shouldn't matter.
Attachment #800832 - Flags: review?(bugs)
The inner loop in ShutdownCollect is now the same as Collect, so just call Collect.
Attachment #800835 - Flags: review?(bugs)
Comment on attachment 800830 [details] [diff] [review] part 1 - Modify nsCycleCollector::Collect to allow it to be used at shutdown. >- void Collect(ccType aCCType, >+ bool Collect(ccType aCCType, >+ nsTArray<PtrInfo*> *aWhiteNodes, Could this be nsTArray<PtrInfo*> &aWhiteNodes Not sure I understand yet the setup... reading other patches.
Attachment #800830 - Flags: review?(bugs) → review+
Attachment #800831 - Flags: review?(bugs) → review+
Attachment #800832 - Flags: review?(bugs) → review+
Attachment #800835 - Flags: review?(bugs) → review+
> Could this be nsTArray<PtrInfo*> &aWhiteNodes Sort of, but it just gets passed through a few functions and stuck into a field mWhiteNodes that has to be a pointer because it is NULL when the CC isn't running. I'm also going to get rid of that argument for ICC anyways, so I'm just going to leave it as a * for now.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: