本文整理汇总了C++中HphpArray::decRefCount方法的典型用法代码示例。如果您正苦于以下问题:C++ HphpArray::decRefCount方法的具体用法?C++ HphpArray::decRefCount怎么用?C++ HphpArray::decRefCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HphpArray
的用法示例。
在下文中一共展示了HphpArray::decRefCount方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: new_iter_array
HOT_FUNC
int64 new_iter_array(Iter* dest, ArrayData* ad, TypedValue* valOut) {
TRACE(2, "%s: I %p, ad %p\n", __func__, dest, ad);
valOut = tvToCell(valOut);
if (UNLIKELY(!IsHphpArray(ad))) {
goto cold;
}
{
HphpArray* arr = (HphpArray*)ad;
if (LIKELY(arr->getSize() != 0)) {
if (UNLIKELY(tvWillBeReleased(valOut))) {
goto cold;
}
tvDecRefOnly(valOut);
// We are transferring ownership of the array to the iterator, therefore
// we do not need to adjust the refcount.
(void) new (&dest->arr()) ArrayIter(arr, ArrayIter::noIncNonNull);
dest->m_itype = Iter::TypeArray;
HphpArray::Elm* elm = arr->getElm(dest->arr().m_pos);
getHphpArrayElm(elm, valOut, NULL);
return 1LL;
}
// We did not transfer ownership of the array to an iterator, so we need
// to decRef the array.
if (UNLIKELY(arr->getCount() == 1)) {
goto cold;
}
arr->decRefCount();
return 0LL;
}
cold:
return new_iter_array_cold(dest, ad, valOut, NULL);
}