Bug 1359245 - Keep a linked list of CycleCollectedJSContexts in the runtime (r=mccr8)
This patch keeps a list of all the cooperatively scheduled contexts that are linked to a runtime. In places where we need to iterate over all contexts (for GC, specifically), it iterates over the list. MozReview-Commit-ID: 3pKJX78f2l0
This commit is contained in:
@@ -562,6 +562,18 @@ CycleCollectedJSRuntime::~CycleCollectedJSRuntime()
|
||||
MOZ_ASSERT(!mDeferredFinalizerTable.Count());
|
||||
}
|
||||
|
||||
void
|
||||
CycleCollectedJSRuntime::AddContext(CycleCollectedJSContext* aContext)
|
||||
{
|
||||
mContexts.insertBack(aContext);
|
||||
}
|
||||
|
||||
void
|
||||
CycleCollectedJSRuntime::RemoveContext(CycleCollectedJSContext* aContext)
|
||||
{
|
||||
aContext->removeFrom(mContexts);
|
||||
}
|
||||
|
||||
size_t
|
||||
CycleCollectedJSRuntime::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user