本文整理汇总了C++中ExplodedGraph::getAllocator方法的典型用法代码示例。如果您正苦于以下问题:C++ ExplodedGraph::getAllocator方法的具体用法?C++ ExplodedGraph::getAllocator怎么用?C++ ExplodedGraph::getAllocator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ExplodedGraph
的用法示例。
在下文中一共展示了ExplodedGraph::getAllocator方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: assert
void ExplodedNode::NodeGroup::addNode(ExplodedNode *N, ExplodedGraph &G) {
assert(!getFlag());
GroupStorage &Storage = reinterpret_cast<GroupStorage&>(P);
if (Storage.isNull()) {
Storage = N;
assert(Storage.is<ExplodedNode *>());
return;
}
ExplodedNodeVector *V = Storage.dyn_cast<ExplodedNodeVector *>();
if (!V) {
// Switch from single-node to multi-node representation.
ExplodedNode *Old = Storage.get<ExplodedNode *>();
BumpVectorContext &Ctx = G.getNodeAllocator();
V = G.getAllocator().Allocate<ExplodedNodeVector>();
new (V) ExplodedNodeVector(Ctx, 4);
V->push_back(Old, Ctx);
Storage = V;
assert(!getFlag());
assert(Storage.is<ExplodedNodeVector *>());
}
V->push_back(N, G.getNodeAllocator());
}
示例2: assert
void ExplodedNode::NodeGroup::addNode(ExplodedNode *N, ExplodedGraph &G) {
assert((reinterpret_cast<uintptr_t>(N) & Mask) == 0x0);
assert(!getFlag());
if (getKind() == Size1) {
if (ExplodedNode *NOld = getNode()) {
BumpVectorContext &Ctx = G.getNodeAllocator();
BumpVector<ExplodedNode*> *V =
G.getAllocator().Allocate<BumpVector<ExplodedNode*> >();
new (V) BumpVector<ExplodedNode*>(Ctx, 4);
assert((reinterpret_cast<uintptr_t>(V) & Mask) == 0x0);
V->push_back(NOld, Ctx);
V->push_back(N, Ctx);
P = reinterpret_cast<uintptr_t>(V) | SizeOther;
assert(getPtr() == (void*) V);
assert(getKind() == SizeOther);
}
else {
P = reinterpret_cast<uintptr_t>(N);
assert(getKind() == Size1);
}
}
else {
assert(getKind() == SizeOther);
getVector(getPtr()).push_back(N, G.getNodeAllocator());
}
}