X-Git-Url: http://plrg.eecs.uci.edu/git/?p=c11tester.git;a=blobdiff_plain;f=nodestack.cc;h=6b1d4ef9c86929fdd14d14172149abaacec96133;hp=f5cb6f0e2f4bcf1b8ee350485825f2afec0d28fb;hb=6f8de9e0f5697652fd20b2ecf149f96bfb572538;hpb=00a4dfc8e9c23117e8e4490be5354f7d95ad73e9 diff --git a/nodestack.cc b/nodestack.cc index f5cb6f0e..6b1d4ef9 100644 --- a/nodestack.cc +++ b/nodestack.cc @@ -4,6 +4,7 @@ #include "action.h" #include "common.h" #include "model.h" +#include "threads.h" /** * @brief Node constructor @@ -273,6 +274,11 @@ bool Node::is_enabled(thread_id_t tid) return thread_id < num_threads && enabled_array[thread_id]; } +bool Node::has_priority(thread_id_t tid) +{ + return fairness[id_to_int(tid)].priority; +} + /** * Add an action to the may_read_from set. * @param act is the action to add @@ -356,16 +362,18 @@ void Node::explore(thread_id_t tid) explored_children[i] = true; } -NodeStack::NodeStack() - : total_nodes(0) +NodeStack::NodeStack() : + node_list(1, new Node()), + iter(0), + total_nodes(0) { - node_list.push_back(new Node()); total_nodes++; - iter = 0; } NodeStack::~NodeStack() { + for (unsigned int i = 0; i < node_list.size(); i++) + delete node_list[i]; } void NodeStack::print() @@ -418,7 +426,7 @@ void NodeStack::pop_restofstack(int numAhead) { /* Diverging from previous execution; clear out remainder of list */ unsigned int it=iter+numAhead; - for(unsigned i=it;i