delete discovered;
}
+/**
+ * Add a CycleNode to the graph, corresponding to a store ModelAction
+ * @param act The write action that should be added
+ * @param node The CycleNode that corresponds to the store
+ */
+void CycleGraph::putNode(const ModelAction *act, CycleNode *node)
+{
+ actionToNode.put(act, node);
+#if SUPPORT_MOD_ORDER_DUMP
+ nodeList.push_back(node);
+#endif
+}
+
/**
* @brief Returns the CycleNode corresponding to a given ModelAction
* @param action The ModelAction to find a node for
CycleNode *node = actionToNode.get(action);
if (node == NULL) {
node = new CycleNode(action);
- actionToNode.put(action, node);
-#if SUPPORT_MOD_ORDER_DUMP
- nodeList.push_back(node);
-#endif
+ putNode(action, node);
}
return node;
}
SNAPSHOTALLOC
private:
+ void putNode(const ModelAction *act, CycleNode *node);
CycleNode * getNode(const ModelAction *);
HashTable<CycleNode *, CycleNode *, uintptr_t, 4, model_malloc, model_calloc, model_free> *discovered;