Comment 43 for bug 286366

Revision history for this message
In , Peterv (peterv) wrote :

Comment on attachment 355654
Fault on OOM in the cycle collector, rev. 1.001

>diff --git a/xpcom/base/nsCycleCollector.cpp b/xpcom/base/nsCycleCollector.cpp

>+ // catch faults that happen during graph building
>+ if (mParams.mDoNothing)
>+ return PR_FALSE;
>
> return PR_TRUE;

Could do return !mParams.mDoNothing;

I was worried that we'd somehow not mark everything for the JS GC, but it looks fine. If BeginCollection returns false nsXPConnect will just mark all the XPConnect JS objects (with TraceXPConnectRoots), and it won't call FinishCollection.