* parent.
*
* @param act The ModelAction to associate with this Node. May be NULL.
- * @param par The parent Node in the NodeStack. May be NULL if there is no
- * parent.
* @param nthreads The number of threads which exist at this point in the
* execution trace.
*/
-Node::Node(ModelAction *act, Node *par, int nthreads) :
+Node::Node(ModelAction *act) :
action(act),
- uninit_action(NULL),
- parent(par),
- num_threads(nthreads)
+ uninit_action(NULL)
{
ASSERT(act);
act->set_node(this);
NodeStack::NodeStack() :
node_list(),
- head_idx(-1),
- total_nodes(0)
+ head_idx(-1)
{
- total_nodes++;
}
NodeStack::~NodeStack()
{
- for (unsigned int i = 0; i < node_list.size(); i++)
+ for (unsigned int i = 0;i < node_list.size();i++)
delete node_list[i];
}
{
model_print("............................................\n");
model_print("NodeStack printing node_list:\n");
- for (unsigned int it = 0; it < node_list.size(); it++) {
+ for (unsigned int it = 0;it < node_list.size();it++) {
if ((int)it == this->head_idx)
model_print("vvv following action is the current iterator vvv\n");
node_list[it]->print();
{
DBG();
- /* Record action */
- Node *head = get_head();
-
- int next_threads = execution->get_num_threads();
- if (act->get_type() == THREAD_CREATE || act->get_type() == PTHREAD_CREATE ) // may need to be changed
- next_threads++;
- node_list.push_back(new Node(act, head, next_threads));
- total_nodes++;
+ node_list.push_back(new Node(act));
head_idx++;
return NULL;
}
/** Reset the node stack. */
-void NodeStack::full_reset()
+void NodeStack::full_reset()
{
- for (unsigned int i = 0; i < node_list.size(); i++)
+ for (unsigned int i = 0;i < node_list.size();i++)
delete node_list[i];
node_list.clear();
reset_execution();
- total_nodes = 1;
}
Node * NodeStack::get_head() const