本文整理汇总了C++中map::Range::empty方法的典型用法代码示例。如果您正苦于以下问题:C++ Range::empty方法的具体用法?C++ Range::empty怎么用?C++ Range::empty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类map::Range
的用法示例。
在下文中一共展示了Range::empty方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MarkObject
bool
WatchpointMap::markIteratively(JSTracer *trc)
{
JSContext *cx = trc->context;
bool marked = false;
for (Map::Range r = map.all(); !r.empty(); r.popFront()) {
Map::Entry &e = r.front();
bool objectIsLive = !IsAboutToBeFinalized(cx, e.key.object);
if (objectIsLive || e.value.held) {
if (!objectIsLive) {
MarkObject(trc, *e.key.object, "held Watchpoint object");
marked = true;
}
jsid id = e.key.id;
JS_ASSERT(JSID_IS_STRING(id) || JSID_IS_INT(id));
MarkId(trc, id, "WatchKey::id");
if (e.value.closure && IsAboutToBeFinalized(cx, e.value.closure)) {
MarkObject(trc, *e.value.closure, "Watchpoint::closure");
marked = true;
}
}
}
return marked;
}
示例2:
size_t
JSObject2WrappedJSMap::SizeOfWrappedJS(mozilla::MallocSizeOf mallocSizeOf) const
{
size_t n = 0;
for (Map::Range r = mTable.all(); !r.empty(); r.popFront())
n += r.front().value()->SizeOfIncludingThis(mallocSizeOf);
return n;
}
示例3:
void
WatchpointMap::trace(WeakMapTracer* trc)
{
for (Map::Range r = map.all(); !r.empty(); r.popFront()) {
Map::Entry& entry = r.front();
trc->trace(nullptr,
JS::GCCellPtr(entry.key().object.get()),
JS::GCCellPtr(entry.value().closure.get()));
}
}
示例4:
/* See the comment on RegExpShared lifetime in RegExpObject.h. */
void
RegExpCompartment::sweep(JSRuntime *rt)
{
#ifdef DEBUG
for (Map::Range r = map_.all(); !r.empty(); r.popFront())
JS_ASSERT(inUse_.has(r.front().value()));
#endif
map_.clear();
for (PendingSet::Enum e(inUse_); !e.empty(); e.popFront()) {
RegExpShared *shared = e.front();
if (shared->activeUseCount == 0 && shared->gcNumberWhenUsed < rt->gcStartNumber) {
js_delete(shared);
e.removeFront();
}
}
}