本文整理汇总了C++中mozilla::ArrayEnd方法的典型用法代码示例。如果您正苦于以下问题:C++ mozilla::ArrayEnd方法的具体用法?C++ mozilla::ArrayEnd怎么用?C++ mozilla::ArrayEnd使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mozilla
的用法示例。
在下文中一共展示了mozilla::ArrayEnd方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: end
bool
js::IndexToIdSlow(ExclusiveContext *cx, uint32_t index, MutableHandleId idp)
{
MOZ_ASSERT(index > JSID_INT_MAX);
char16_t buf[UINT32_CHAR_BUFFER_LENGTH];
RangedPtr<char16_t> end(ArrayEnd(buf), buf, ArrayEnd(buf));
RangedPtr<char16_t> start = BackfillIndexInCharBuffer(index, end);
JSAtom *atom = AtomizeChars(cx, start.get(), end - start);
if (!atom)
return false;
idp.set(JSID_FROM_BITS((size_t)atom));
return true;
}
示例2: end
bool
js::IndexToIdSlow(JSContext *cx, uint32_t index,
typename MaybeRooted<jsid, allowGC>::MutableHandleType idp)
{
JS_ASSERT(index > JSID_INT_MAX);
jschar buf[UINT32_CHAR_BUFFER_LENGTH];
RangedPtr<jschar> end(ArrayEnd(buf), buf, ArrayEnd(buf));
RangedPtr<jschar> start = BackfillIndexInCharBuffer(index, end);
JSAtom *atom = AtomizeChars<allowGC>(cx, start.get(), end - start);
if (!atom)
return false;
idp.set(JSID_FROM_BITS((size_t)atom));
return true;
}
示例3: MarkKind
static JS_NEVER_INLINE void
MarkConservativeStackRoots(JSTracer *trc, bool useSavedRoots)
{
JSRuntime *rt = trc->runtime;
#ifdef DEBUG
if (useSavedRoots) {
for (PerThreadData::SavedGCRoot *root = rt->mainThread.gcSavedRoots.begin();
root != rt->mainThread.gcSavedRoots.end();
root++)
{
JS_SET_TRACING_NAME(trc, "cstack");
MarkKind(trc, &root->thing, root->kind);
}
return;
}
if (rt->gcIncrementalState == MARK_ROOTS)
rt->mainThread.gcSavedRoots.clearAndFree();
#endif
ConservativeGCData *cgcd = &rt->conservativeGC;
if (!cgcd->hasStackToScan()) {
#ifdef JS_THREADSAFE
JS_ASSERT(!rt->requestDepth);
#endif
return;
}
uintptr_t *stackMin, *stackEnd;
#if JS_STACK_GROWTH_DIRECTION > 0
stackMin = rt->nativeStackBase;
stackEnd = cgcd->nativeStackTop;
#else
stackMin = cgcd->nativeStackTop + 1;
stackEnd = reinterpret_cast<uintptr_t *>(rt->nativeStackBase);
#endif
JS_ASSERT(stackMin <= stackEnd);
MarkRangeConservativelyAndSkipIon(trc, rt, stackMin, stackEnd);
MarkRangeConservatively(trc, cgcd->registerSnapshot.words,
ArrayEnd(cgcd->registerSnapshot.words));
}
示例4: MarkKind
MOZ_NEVER_INLINE void
gc::GCRuntime::markConservativeStackRoots(JSTracer *trc, bool useSavedRoots)
{
#ifdef DEBUG
if (useSavedRoots) {
for (PerThreadData::SavedGCRoot *root = rt->mainThread.gcSavedRoots.begin();
root != rt->mainThread.gcSavedRoots.end();
root++)
{
trc->setTracingName("cstack");
MarkKind(trc, &root->thing, root->kind);
}
return;
}
if (incrementalState == MARK_ROOTS)
rt->mainThread.gcSavedRoots.clearAndFree();
#endif
if (!conservativeGC.hasStackToScan()) {
#ifdef JS_THREADSAFE
JS_ASSERT(!rt->requestDepth);
#endif
return;
}
uintptr_t *stackMin, *stackEnd;
#if JS_STACK_GROWTH_DIRECTION > 0
stackMin = reinterpret_cast<uintptr_t *>(rt->nativeStackBase);
stackEnd = conservativeGC.nativeStackTop;
#else
stackMin = conservativeGC.nativeStackTop + 1;
stackEnd = reinterpret_cast<uintptr_t *>(rt->nativeStackBase);
#endif
JS_ASSERT(stackMin <= stackEnd);
MarkRangeConservativelyAndSkipIon(trc, rt, stackMin, stackEnd);
MarkRangeConservatively(trc, conservativeGC.registerSnapshot.words,
ArrayEnd(conservativeGC.registerSnapshot.words));
}