From: root Date: Tue, 30 Jul 2019 21:03:06 +0000 (-0700) Subject: edits X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=b5616956278833cd5e549d2b00fb7ef4ea183575;p=c11tester.git edits --- diff --git a/execution.cc b/execution.cc index 38571bec..679a3d1b 100644 --- a/execution.cc +++ b/execution.cc @@ -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 * 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 * 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* 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* 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) diff --git a/stl-model.h b/stl-model.h index cefadcba..77040e2c 100644 --- a/stl-model.h +++ b/stl-model.h @@ -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: