本文整理汇总了C++中BlockScopeRawPtr::getMark方法的典型用法代码示例。如果您正苦于以下问题:C++ BlockScopeRawPtr::getMark方法的具体用法?C++ BlockScopeRawPtr::getMark怎么用?C++ BlockScopeRawPtr::getMark使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BlockScopeRawPtr
的用法示例。
在下文中一共展示了BlockScopeRawPtr::getMark方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addUse
void BlockScope::addUse(BlockScopeRawPtr user, int useKinds) {
if (is(ClassScope) ? static_cast<HPHP::ClassScope*>(this)->isUserClass() :
is(FunctionScope) &&
static_cast<HPHP::FunctionScope*>(this)->isUserFunction()) {
if (user.get() == this) {
m_selfUser |= useKinds;
return;
}
Lock lock(s_depsMutex);
Lock l2(s_jobStateMutex);
std::pair<BlockScopeRawPtrFlagsHashMap::iterator,bool> val =
m_userMap.insert(BlockScopeRawPtrFlagsHashMap::value_type(user,
useKinds));
if (val.second) {
m_orderedUsers.push_back(&*val.first);
user->m_orderedDeps.push_back(
std::make_pair(BlockScopeRawPtr(this), &(val.first->second)));
ASSERT(user->getMark() != BlockScope::MarkReady &&
user->getMark() != BlockScope::MarkWaiting);
} else {
val.first->second |= useKinds;
}
}
}
示例2: addUse
void BlockScope::addUse(BlockScopeRawPtr user, int useKinds) {
if ((is(ClassScope) || is(FunctionScope)) && !isBuiltin()) {
if (user.get() == this) {
m_selfUser |= useKinds;
return;
}
Lock lock(s_depsMutex);
Lock l2(s_jobStateMutex);
auto val = m_userMap.emplace(user, useKinds);
if (val.second) {
m_orderedUsers.push_back(&*val.first);
user->m_orderedDeps.emplace_back(BlockScopeRawPtr{this},
&(val.first->second));
assert(user->getMark() != BlockScope::MarkReady &&
user->getMark() != BlockScope::MarkWaiting);
} else {
val.first->second |= useKinds;
}
}
}