datarace: don't export unrealized race vector
[cdsspec-compiler.git] / execution.h
index 6810fee665a6b018cbec1c353b12f22667a8c42e..8a2bcfa9402a8b2d9c0153aa743c5fc5554613cf 100644 (file)
@@ -14,7 +14,6 @@
 #include "config.h"
 #include "modeltypes.h"
 #include "stl-model.h"
-#include "context.h"
 #include "params.h"
 
 /* Forward declaration */
@@ -61,9 +60,14 @@ struct release_seq {
 /** @brief The central structure for model-checking */
 class ModelExecution {
 public:
-       ModelExecution(struct model_params *params, Scheduler *scheduler, NodeStack *node_stack);
+       ModelExecution(ModelChecker *m,
+                       struct model_params *params,
+                       Scheduler *scheduler,
+                       NodeStack *node_stack);
        ~ModelExecution();
 
+       const struct model_params * get_params() const { return params; }
+
        Thread * take_step(ModelAction *curr);
        void fixup_release_sequences();
 
@@ -109,12 +113,14 @@ public:
 
        ModelAction * get_next_backtrack();
 
-       action_list_t * get_action_trace() const { return action_trace; }
-
-       void increment_execution_number() { execution_number++; }
+       action_list_t * get_action_trace() { return &action_trace; }
 
-       MEMALLOC
+       SNAPSHOTALLOC
 private:
+       int get_execution_number() const;
+
+       ModelChecker *model;
+
        const model_params * const params;
 
        /** The scheduler to use: tracks the running/ready Threads */
@@ -181,20 +187,20 @@ private:
 
        ModelAction * get_uninitialized_action(const ModelAction *curr) const;
 
-       action_list_t * const action_trace;
-       HashTable<int, Thread *, int> * const thread_map;
+       action_list_t action_trace;
+       SnapVector<Thread *> thread_map;
 
        /** Per-object list of actions. Maps an object (i.e., memory location)
         * to a trace of all actions performed on the object. */
-       HashTable<const void *, action_list_t *, uintptr_t, 4> * const obj_map;
+       HashTable<const void *, action_list_t *, uintptr_t, 4> obj_map;
 
        /** Per-object list of actions. Maps an object (i.e., memory location)
         * to a trace of all actions performed on the object. */
-       HashTable<const void *, action_list_t *, uintptr_t, 4> * const condvar_waiters_map;
+       HashTable<const void *, action_list_t *, uintptr_t, 4> condvar_waiters_map;
 
-       HashTable<void *, SnapVector<action_list_t> *, uintptr_t, 4 > * const obj_thrd_map;
-       SnapVector<Promise *> * const promises;
-       SnapVector<struct PendingFutureValue> * const futurevalues;
+       HashTable<void *, SnapVector<action_list_t> *, uintptr_t, 4> obj_thrd_map;
+       SnapVector<Promise *> promises;
+       SnapVector<struct PendingFutureValue> futurevalues;
 
        /**
         * List of pending release sequences. Release sequences might be
@@ -202,10 +208,10 @@ private:
         * are established. Each entry in the list may only be partially
         * filled, depending on its pending status.
         */
-       SnapVector<struct release_seq *> * const pending_rel_seqs;
+       SnapVector<struct release_seq *> pending_rel_seqs;
 
-       SnapVector<ModelAction *> * const thrd_last_action;
-       SnapVector<ModelAction *> * const thrd_last_fence_release;
+       SnapVector<ModelAction *> thrd_last_action;
+       SnapVector<ModelAction *> thrd_last_fence_release;
        NodeStack * const node_stack;
 
        /** A special model-checker Thread; used for associating with
@@ -232,8 +238,6 @@ private:
         */
        CycleGraph * const mo_graph;
 
-       int execution_number;
-
        Thread * action_select_next_thread(const ModelAction *curr) const;
 };