本文整理汇总了C++中ZoneSet::put方法的典型用法代码示例。如果您正苦于以下问题:C++ ZoneSet::put方法的具体用法?C++ ZoneSet::put怎么用?C++ ZoneSet::put使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ZoneSet
的用法示例。
在下文中一共展示了ZoneSet::put方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
bool
RootList::init(HandleObject debuggees)
{
MOZ_ASSERT(debuggees && JS::dbg::IsDebugger(ObjectValue(*debuggees)));
js::Debugger *dbg = js::Debugger::fromJSObject(debuggees);
ZoneSet debuggeeZones;
if (!debuggeeZones.init())
return false;
for (js::WeakGlobalObjectSet::Range r = dbg->allDebuggees(); !r.empty(); r.popFront()) {
if (!debuggeeZones.put(r.front()->zone()))
return false;
}
if (!init(debuggeeZones))
return false;
// Ensure that each of our debuggee globals are in the root list.
for (js::WeakGlobalObjectSet::Range r = dbg->allDebuggees(); !r.empty(); r.popFront()) {
if (!addRoot(JS::ubi::Node(static_cast<JSObject *>(r.front())),
MOZ_UTF16("debuggee global")))
{
return false;
}
}
return true;
}
示例2:
// If we are only taking a snapshot of the heap affected by the given set of
// globals, find the set of zones the globals are allocated within. Returns
// false on OOM failure.
static bool
PopulateZonesWithGlobals(ZoneSet& zones, AutoObjectVector& globals)
{
if (!zones.init())
return false;
unsigned length = globals.length();
for (unsigned i = 0; i < length; i++) {
if (!zones.put(GetObjectZone(globals[i])))
return false;
}
return true;
}
示例3: tracer
bool
RootList::init(CompartmentSet& debuggees)
{
EdgeVector allRootEdges;
EdgeVectorTracer tracer(rt, &allRootEdges, wantNames);
ZoneSet debuggeeZones;
if (!debuggeeZones.init())
return false;
for (auto range = debuggees.all(); !range.empty(); range.popFront()) {
if (!debuggeeZones.put(range.front()->zone()))
return false;
}
js::TraceRuntime(&tracer);
if (!tracer.okay)
return false;
TraceIncomingCCWs(&tracer, debuggees);
if (!tracer.okay)
return false;
for (EdgeVector::Range r = allRootEdges.all(); !r.empty(); r.popFront()) {
Edge& edge = r.front();
JSCompartment* compartment = edge.referent.compartment();
if (compartment && !debuggees.has(compartment))
continue;
Zone* zone = edge.referent.zone();
if (zone && !debuggeeZones.has(zone))
continue;
if (!edges.append(mozilla::Move(edge)))
return false;
}
noGC.emplace(rt);
return true;
}