My configuration
[c11tester.git] / execution.cc
index 05591751b14a8db61ba0a7e3ff6619c311260e1d..8853bfeefee1a44a7a05e220999ceb057ecc385e 100644 (file)
@@ -63,7 +63,11 @@ ModelExecution::ModelExecution(ModelChecker *m, Scheduler *scheduler) :
        thrd_last_fence_release(),
        priv(new struct model_snapshot_members ()),
        mo_graph(new CycleGraph()),
+#ifdef NEWFUZZER
+       fuzzer(new NewFuzzer()),
+#else
        fuzzer(new Fuzzer()),
+#endif
        isfinished(false)
 {
        /* Initialize a model-checker thread, for special ModelActions */
@@ -275,7 +279,9 @@ ModelAction * ModelExecution::convertNonAtomicStore(void * location) {
        add_normal_write_to_lists(act);
        add_write_to_lists(act);
        w_modification_order(act);
+#ifdef NEWFUZZER
        model->get_history()->process_action(act, act->get_tid());
+#endif
        return act;
 }
 
@@ -1135,7 +1141,7 @@ void ModelExecution::add_action_to_lists(ModelAction *act, bool canprune)
                for(uint i = oldsize;i < priv->next_thread_id;i++)
                        new (&(*vec)[i]) action_list_t();
        }
-       if (!canprune)
+       if (!canprune && (act->is_read() || act->is_write()))
                act->setThrdMapRef((*vec)[tid].add_back(act));
 
        // Update thrd_last_action, the last action taken by each thread
@@ -1153,15 +1159,6 @@ void ModelExecution::add_action_to_lists(ModelAction *act, bool canprune)
        if (act->is_wait()) {
                void *mutex_loc = (void *) act->get_value();
                act->setActionRef(get_safe_ptr_action(&obj_map, mutex_loc)->add_back(act));
-
-               SnapVector<action_list_t> *vec = get_safe_ptr_vect_action(&obj_thrd_map, mutex_loc);
-               if ((int)vec->size() <= tid) {
-                       uint oldsize = vec->size();
-                       vec->resize(priv->next_thread_id);
-                       for(uint i = oldsize;i < priv->next_thread_id;i++)
-                               new (&(*vec)[i]) action_list_t();
-               }
-               act->setThrdMapRef((*vec)[tid].add_back(act));
        }
 }
 
@@ -1652,8 +1649,9 @@ Thread * ModelExecution::take_step(ModelAction *curr)
        ASSERT(curr);
 
        /* Process this action in ModelHistory for records */
+#ifdef NEWFUZZER
        model->get_history()->process_action( curr, curr->get_tid() );
-
+#endif
        if (curr_thrd->is_blocked() || curr_thrd->is_complete())
                scheduler->remove_thread(curr_thrd);