Handle pathological case
[c11tester.git] / action.cc
index df73d2099cc7641be668e03878bfc29f61e190fc..af42a1f06e952580b2f984c2f81c134b89748bf4 100644 (file)
--- a/action.cc
+++ b/action.cc
@@ -38,14 +38,9 @@ ModelAction::ModelAction(action_type_t type, memory_order order, void *loc,
        last_fence_release(NULL),
        cv(NULL),
        rf_cv(NULL),
-       trace_ref(NULL),
-       thrdmap_ref(NULL),
        action_ref(NULL),
-       func_act_ref(NULL),
        value(value),
        type(type),
-       original_type(ATOMIC_NOP),
-       swap_flag(false),
        order(order),
        original_order(order),
        seq_number(ACTION_INITIAL_CLOCK)
@@ -75,14 +70,9 @@ ModelAction::ModelAction(action_type_t type, memory_order order, uint64_t value,
        last_fence_release(NULL),
        cv(NULL),
        rf_cv(NULL),
-       trace_ref(NULL),
-       thrdmap_ref(NULL),
        action_ref(NULL),
-       func_act_ref(NULL),
        value(value),
        type(type),
-       original_type(ATOMIC_NOP),
-       swap_flag(false),
        order(order),
        original_order(order),
        seq_number(ACTION_INITIAL_CLOCK)
@@ -111,14 +101,9 @@ ModelAction::ModelAction(action_type_t type, memory_order order, void *loc,
        last_fence_release(NULL),
        cv(NULL),
        rf_cv(NULL),
-       trace_ref(NULL),
-       thrdmap_ref(NULL),
        action_ref(NULL),
-       func_act_ref(NULL),
        value(value),
        type(type),
-       original_type(ATOMIC_NOP),
-       swap_flag(false),
        order(order),
        original_order(order),
        seq_number(ACTION_INITIAL_CLOCK)
@@ -151,14 +136,9 @@ ModelAction::ModelAction(action_type_t type, const char * position, memory_order
        last_fence_release(NULL),
        cv(NULL),
        rf_cv(NULL),
-       trace_ref(NULL),
-       thrdmap_ref(NULL),
        action_ref(NULL),
-       func_act_ref(NULL),
        value(value),
        type(type),
-       original_type(ATOMIC_NOP),
-       swap_flag(false),
        order(order),
        original_order(order),
        seq_number(ACTION_INITIAL_CLOCK)
@@ -192,14 +172,9 @@ ModelAction::ModelAction(action_type_t type, const char * position, memory_order
        last_fence_release(NULL),
        cv(NULL),
        rf_cv(NULL),
-       trace_ref(NULL),
-       thrdmap_ref(NULL),
        action_ref(NULL),
-       func_act_ref(NULL),
        value(value),
        type(type),
-       original_type(ATOMIC_NOP),
-       swap_flag(false),
        order(order),
        original_order(order),
        seq_number(ACTION_INITIAL_CLOCK)
@@ -222,9 +197,11 @@ ModelAction::~ModelAction()
         * vectors which have already been rolled back to an unallocated state.
         */
 
-       /*
-          if (cv)
-               delete cv; */
+
+       if (cv)
+               delete cv;
+       if (rf_cv)
+               delete rf_cv;
 }
 
 int ModelAction::getSize() const {
@@ -623,7 +600,7 @@ uint64_t ModelAction::get_reads_from_value() const
  */
 uint64_t ModelAction::get_write_value() const
 {
-       ASSERT(is_write() || is_free());
+       ASSERT(is_write());
        return value;
 }
 
@@ -787,16 +764,3 @@ cdsc::mutex * ModelAction::get_mutex() const
        else
                return NULL;
 }
-
-/** @brief Swap type with original type */
-void ModelAction::use_original_type()
-{
-       action_type_t tmp = type;
-       type = original_type;
-       original_type = tmp;
-
-       if (swap_flag)
-               swap_flag = false;
-       else
-               swap_flag = true;
-}