if (tonode != rmwnode) {
rmwnode->addEdge(tonode);
}
+ tonode->refcount--;
}
fromnode->edges.clear();
CycleNode::CycleNode(const ModelAction *act) :
action(act),
hasRMW(NULL),
- cv(new ClockVector(NULL, act))
+ cv(new ClockVector(NULL, act)),
+ refcount(0)
{
}
return edges.size();
}
-/**
- * @brief Remove a (forward) edge from this CycleNode
- * @return The CycleNode which was popped, if one exists; otherwise NULL
- */
-CycleNode * CycleNode::removeEdge()
-{
- if (edges.empty())
- return NULL;
-
- CycleNode *ret = edges.back();
- edges.pop_back();
- return ret;
-}
-
/**
* Adds an edge from this CycleNode to another CycleNode.
* @param node The node to which we add a directed edge
if (edges[i] == node)
return;
edges.push_back(node);
+ node->refcount++;
}
/** @returns the RMW CycleNode that reads from the current CycleNode */