edits
authorroot <root@dw-6.eecs.uci.edu>
Tue, 30 Jul 2019 21:03:06 +0000 (14:03 -0700)
committerroot <root@dw-6.eecs.uci.edu>
Tue, 30 Jul 2019 21:03:06 +0000 (14:03 -0700)
execution.cc
stl-model.h

index 38571bec2c22169147903eb3d9ac21a4372b607b..679a3d1b9489a577be03ee1a0370c3dd9ab21ba2 100644 (file)
@@ -440,10 +440,10 @@ bool ModelExecution::process_fence(ModelAction *curr)
        bool updated = false;
        if (curr->is_acquire()) {
                action_list_t *list = &action_trace;
-               action_list_t::reverse_iterator rit;
+               sllnode<ModelAction *> * rit;
                /* Find X : is_read(X) && X --sb-> curr */
-               for (rit = list->rbegin();rit != list->rend();rit++) {
-                       ModelAction *act = *rit;
+               for (rit = list->end();rit != NULL;rit=rit->getPrev()) {
+                 ModelAction *act = rit->getVal();
                        if (act == curr)
                                continue;
                        if (act->get_tid() != curr->get_tid())
@@ -804,9 +804,9 @@ bool ModelExecution::r_modification_order(ModelAction *curr, const ModelAction *
 
                /* Iterate over actions in thread, starting from most recent */
                action_list_t *list = &(*thrd_lists)[tid];
-               action_list_t::reverse_iterator rit;
-               for (rit = list->rbegin();rit != list->rend();rit++) {
-                       ModelAction *act = *rit;
+               sllnode<ModelAction *> * rit;
+               for (rit = list->end();rit != NULL;rit=rit->getPrev()) {
+                 ModelAction *act = rit->getVal();
 
                        /* Skip curr */
                        if (act == curr)
@@ -936,9 +936,9 @@ void ModelExecution::w_modification_order(ModelAction *curr)
 
                /* Iterate over actions in thread, starting from most recent */
                action_list_t *list = &(*thrd_lists)[i];
-               action_list_t::reverse_iterator rit;
-               for (rit = list->rbegin();rit != list->rend();rit++) {
-                       ModelAction *act = *rit;
+               sllnode<ModelAction*>* rit;
+               for (rit = list->end();rit != NULL;rit=rit->getPrev()) {
+                 ModelAction *act = rit->getVal();
                        if (act == curr) {
                                /*
                                 * 1) If RMW and it actually read from something, then we
@@ -1010,9 +1010,9 @@ bool ModelExecution::mo_may_allow(const ModelAction *writer, const ModelAction *
 
                /* Iterate over actions in thread, starting from most recent */
                action_list_t *list = &(*thrd_lists)[i];
-               action_list_t::reverse_iterator rit;
-               for (rit = list->rbegin();rit != list->rend();rit++) {
-                       ModelAction *act = *rit;
+               sllnode<ModelAction *>* rit;
+               for (rit = list->end();rit != NULL;rit=rit->getPrev()) {
+                 ModelAction *act = rit->getVal();
 
                        /* Don't disallow due to act == reader */
                        if (!reader->happens_before(act) || reader == act)
index cefadcba762f24d54c6ba82e743ca7addecdac1c..77040e2c4d0dbc9e423b22e0a5d6712bab4ef469 100644 (file)
@@ -147,6 +147,10 @@ public:
   uint size() {
     return _size;
   }
+
+  bool empty() {
+    return _size == 0;
+  }
   
   MEMALLOC;
  private:
@@ -295,6 +299,9 @@ public:
   uint size() {
     return _size;
   }
+  bool empty() {
+    return _size == 0;
+  }
   
   SNAPSHOTALLOC;
  private: