fix tabbing comment issue
authorbdemsky <bdemsky@uci.edu>
Wed, 12 Jun 2019 20:25:50 +0000 (13:25 -0700)
committerbdemsky <bdemsky@uci.edu>
Wed, 12 Jun 2019 20:25:50 +0000 (13:25 -0700)
33 files changed:
C.cfg
action.cc
action.h
bugmessage.h
clockvector.h
common.cc
common.h
config.h
context.cc
context.h
cyclegraph.cc
cyclegraph.h
datarace.h
execution.cc
execution.h
futex.cc
hashtable.h
main.cc
model.cc
model.h
mymemory.cc
mymemory.h
nodestack.h
output.h
params.h
pthread.cc
schedule.cc
schedule.h
snapshot.cc
stacktrace.h
stl-model.h
threads-model.h
threads.cc

diff --git a/C.cfg b/C.cfg
index a464e72d68352a4cdc151037aae2fb3b64e14bf4..dc4bf83dfd8f16cf0f29af6a500d725c7b7dfb86 100644 (file)
--- a/C.cfg
+++ b/C.cfg
@@ -11,3 +11,6 @@ sp_special_semi                           = ignore
 sp_before_semi                            = ignore
 sp_before_semi_for_empty                  = ignore
 sp_after_semi_for_empty                   = ignore
+sp_before_tr_emb_cmt = force
+sp_num_before_tr_emb_cmt = 2
+indent_relative_single_line_comments = true
\ No newline at end of file
index d4cdb5303bfbdf58e7ba104e5cf9f7514822bc4c..9c0e29920e362f5d2a2fa7d3681077dad4b7690a 100644 (file)
--- a/action.cc
+++ b/action.cc
@@ -465,7 +465,7 @@ uint64_t ModelAction::get_reads_from_value() const
        ASSERT(is_read());
        if (reads_from)
                return reads_from->get_write_value();
-       return VALUE_NONE;   // Only for new actions with no reads-from
+       return VALUE_NONE;      // Only for new actions with no reads-from
 }
 
 /**
@@ -523,7 +523,7 @@ void ModelAction::set_read_from(const ModelAction *act)
 
        reads_from = act;
 
-       if (act->is_uninitialized()) {                                                                                                // WL
+       if (act->is_uninitialized()) {  // WL
                uint64_t val = *((uint64_t *) location);
                ModelAction * act_initialized = (ModelAction *)act;
                act_initialized->set_value(val);
index e831df803331a8c55d8689c6bdeda28fc8221287..2bde6b856e63379cbeb21bd1efec259662ae4898 100644 (file)
--- a/action.h
+++ b/action.h
@@ -47,29 +47,29 @@ using std::memory_order_seq_cst;
 /** @brief Represents an action type, identifying one of several types of
  * ModelAction */
 typedef enum action_type {
-       THREAD_CREATE, // < A thread creation action
-       THREAD_START, // < First action in each thread
-       THREAD_YIELD, // < A thread yield action
-       THREAD_JOIN,  // < A thread join action
-       THREAD_FINISH, // < A thread completion action
-       PTHREAD_CREATE, // < A pthread creation action
-       PTHREAD_JOIN, // < A pthread join action
-       ATOMIC_UNINIT, // < Represents an uninitialized atomic
-       ATOMIC_READ,  // < An atomic read action
-       ATOMIC_WRITE, // < An atomic write action
-       ATOMIC_RMWR, // < The read part of an atomic RMW action
-       ATOMIC_RMWRCAS,  // < The read part of an atomic RMW action
-       ATOMIC_RMW, // < The write part of an atomic RMW action
-       ATOMIC_RMWC,  // < Convert an atomic RMW action into a READ
-       ATOMIC_INIT, // < Initialization of an atomic object (e.g., atomic_init())
-       ATOMIC_FENCE, // < A fence action
-       ATOMIC_LOCK,  // < A lock action
-       ATOMIC_TRYLOCK,  // < A trylock action
-       ATOMIC_UNLOCK, // < An unlock action
-       ATOMIC_NOTIFY_ONE, // < A notify_one action
-       ATOMIC_NOTIFY_ALL,  // < A notify all action
-       ATOMIC_WAIT,  // < A wait action
-       ATOMIC_ANNOTATION, // < An annotation action to pass information to a trace analysis
+       THREAD_CREATE,  // < A thread creation action
+       THREAD_START,   // < First action in each thread
+       THREAD_YIELD,   // < A thread yield action
+       THREAD_JOIN,    // < A thread join action
+       THREAD_FINISH,  // < A thread completion action
+       PTHREAD_CREATE, // < A pthread creation action
+       PTHREAD_JOIN,   // < A pthread join action
+       ATOMIC_UNINIT,  // < Represents an uninitialized atomic
+       ATOMIC_READ,    // < An atomic read action
+       ATOMIC_WRITE,   // < An atomic write action
+       ATOMIC_RMWR,    // < The read part of an atomic RMW action
+       ATOMIC_RMWRCAS, // < The read part of an atomic RMW action
+       ATOMIC_RMW,     // < The write part of an atomic RMW action
+       ATOMIC_RMWC,    // < Convert an atomic RMW action into a READ
+       ATOMIC_INIT,    // < Initialization of an atomic object (e.g., atomic_init())
+       ATOMIC_FENCE,   // < A fence action
+       ATOMIC_LOCK,    // < A lock action
+       ATOMIC_TRYLOCK, // < A trylock action
+       ATOMIC_UNLOCK,  // < An unlock action
+       ATOMIC_NOTIFY_ONE,      // < A notify_one action
+       ATOMIC_NOTIFY_ALL,      // < A notify all action
+       ATOMIC_WAIT,    // < A wait action
+       ATOMIC_ANNOTATION,      // < An annotation action to pass information to a trace analysis
        NOOP
 } action_type_t;
 
@@ -236,4 +236,4 @@ private:
        modelclock_t seq_number;
 };
 
-#endif/* __ACTION_H__ */
+#endif /* __ACTION_H__ */
index bab57381c05c227b8df98abea809dff952985bf3..eda457e069d008e7303e1a1d168d06a105ef31db 100644 (file)
@@ -18,4 +18,4 @@ struct bug_message {
        SNAPSHOTALLOC
 };
 
-#endif/* __BUGMESSAGE_H__ */
+#endif /* __BUGMESSAGE_H__ */
index b9987b22a6f310a70fda2d39ede5fe84ccc62906..430dc1771bc9c03f09bfbb01f2e16e46c4744e57 100644 (file)
@@ -28,4 +28,4 @@ private:
        int num_threads;
 };
 
-#endif/* __CLOCKVECTOR_H__ */
+#endif /* __CLOCKVECTOR_H__ */
index f327d27ed9e122a68ab1c8a1a831c9f62a928ef6..904a298e9070327100e968daf55573fc25afcbf4 100644 (file)
--- a/common.cc
+++ b/common.cc
@@ -37,7 +37,7 @@ void print_trace(void)
                model_print("\t%s\n", strings[i]);
 
        free(strings);
-#endif/* CONFIG_STACKTRACE */
+#endif /* CONFIG_STACKTRACE */
 }
 
 void assert_hook(void)
@@ -170,4 +170,4 @@ void print_program_output()
 
        model_print("---- END PROGRAM OUTPUT   ----\n");
 }
-#endif/* ! CONFIG_DEBUG */
+#endif /* ! CONFIG_DEBUG */
index 1b2b673f1fd3c81b8e342fbfa68205163b216135..81af78644ac0401a92c61ba20d82fa3711e0f401 100644 (file)
--- a/common.h
+++ b/common.h
@@ -38,9 +38,9 @@ void assert_hook(void);
 #else
 #define ASSERT(expr) \
        do { } while (0)
-#endif/* CONFIG_ASSERT */
+#endif /* CONFIG_ASSERT */
 
 #define error_msg(...) fprintf(stderr, "Error: " __VA_ARGS__)
 
 void print_trace(void);
-#endif/* __COMMON_H__ */
+#endif /* __COMMON_H__ */
index ac725c3582c6f05c9d39c7d176b82ddd430c97fa..43c044278eac3350d507309f86a9b05582308ca8 100644 (file)
--- a/config.h
+++ b/config.h
@@ -27,7 +27,7 @@
 #else
 #define BIT48 0
 #endif
-#endif/* BIT48 */
+#endif /* BIT48 */
 
 /** Snapshotting configurables */
 
index d446fa76ba9248fec4a6666775b5c11bd192d907..6dc43d8aac022c073ee4d60730d06fc460791836 100644 (file)
@@ -24,4 +24,4 @@ int model_swapcontext(ucontext_t *oucp, ucontext_t *ucp)
        return 0;
 }
 
-#endif/* MAC */
+#endif /* MAC */
index f0003ce4c4fd4637f9b86cef7d0e45a08382c552..aa356a9266c326111001492e20a4820ef74ddfd8 100644 (file)
--- a/context.h
+++ b/context.h
@@ -20,6 +20,6 @@ static inline int model_swapcontext(ucontext_t *oucp, ucontext_t *ucp)
        return swapcontext(oucp, ucp);
 }
 
-#endif/* !MAC */
+#endif /* !MAC */
 
-#endif/* __CONTEXT_H__ */
+#endif /* __CONTEXT_H__ */
index f4590bfb6fa1cd44b41efdd91157ddcdfa812d78..8acbb4edcfd5db2f719fb5f2c9d85422047b3a10 100644 (file)
@@ -69,7 +69,7 @@ bool CycleGraph::addNodeEdge(CycleNode *fromnode, CycleNode *tonode)
                if (!hasCycles)
                        hasCycles = checkReachable(tonode, fromnode);
        } else
-               return false;                                                   /* No new edge */
+               return false;/* No new edge */
 
        /*
         * If the fromnode has a rmwnode that is not the tonode, we should
index d273279a6e8aa322e2eb01aed3ebb5d1082a15eb..7a90f5cf3318ec039c8fc2f14fc8469dfe57d50d 100644 (file)
@@ -112,4 +112,4 @@ private:
        CycleNode *hasRMW;
 };
 
-#endif/* __CYCLEGRAPH_H__ */
+#endif /* __CYCLEGRAPH_H__ */
index ce659d1ac7792793f253fa93378437f6060351c5..a83116bb311d21fe5b0bc738baf9ebc21b318664 100644 (file)
@@ -89,4 +89,4 @@ struct RaceRecord {
 #define MAXREADVECTOR (READMASK-1)
 #define MAXWRITEVECTOR (WRITEMASK-1)
 
-#endif/* __DATARACE_H__ */
+#endif /* __DATARACE_H__ */
index f498efbb8d5250df4d07304802516ea8e7f1573f..e253ab0f2611e65898173fc504177a040ea394dd 100644 (file)
@@ -57,7 +57,7 @@ ModelExecution::ModelExecution(ModelChecker *m,
        params(NULL),
        scheduler(scheduler),
        action_trace(),
-       thread_map(2),                  /* We'll always need at least 2 threads */
+       thread_map(2),  /* We'll always need at least 2 threads */
        pthread_map(0),
        pthread_counter(0),
        obj_map(),
@@ -368,7 +368,7 @@ bool ModelExecution::process_mutex(ModelAction *curr)
                state->locked = NULL;
 
                if (!curr->is_wait())
-                       break;                                                                  /* The rest is only for ATOMIC_WAIT */
+                       break;/* The rest is only for ATOMIC_WAIT */
 
                break;
        }
@@ -504,15 +504,15 @@ bool ModelExecution::process_thread_action(ModelAction *curr)
                Thread *blocking = curr->get_thread_operand();
                ModelAction *act = get_last_action(blocking->get_id());
                synchronize(act, curr);
-               updated = true;                                                 /* trigger rel-seq checks */
+               updated = true; /* trigger rel-seq checks */
                break;
        }
        case PTHREAD_JOIN: {
                Thread *blocking = curr->get_thread_operand();
                ModelAction *act = get_last_action(blocking->get_id());
                synchronize(act, curr);
-               updated = true;                                                 /* trigger rel-seq checks */
-               break;                                          // WL: to be add (modified)
+               updated = true; /* trigger rel-seq checks */
+               break;  // WL: to be add (modified)
        }
 
        case THREAD_FINISH: {
@@ -525,7 +525,7 @@ bool ModelExecution::process_thread_action(ModelAction *curr)
                                scheduler->wake(waiting);
                }
                th->complete();
-               updated = true;                                                 /* trigger rel-seq checks */
+               updated = true; /* trigger rel-seq checks */
                break;
        }
        case THREAD_START: {
@@ -579,7 +579,7 @@ bool ModelExecution::initialize_curr_action(ModelAction **curr)
                newcurr->create_cv(get_parent_action(newcurr->get_tid()));
 
                *curr = newcurr;
-               return false;                                                   /* Action was explored previously */
+               return false;   /* Action was explored previously */
        } else {
                newcurr = *curr;
 
@@ -589,7 +589,7 @@ bool ModelExecution::initialize_curr_action(ModelAction **curr)
                /* Assign most recent release fence */
                newcurr->set_last_fence_release(get_last_fence_release(newcurr->get_tid()));
 
-               return true;                                            /* This was a new ModelAction */
+               return true;    /* This was a new ModelAction */
        }
 }
 
@@ -1070,7 +1070,7 @@ bool ModelExecution::release_seq_heads(const ModelAction *rf,
                else if (rf->get_last_fence_release())
                        release_heads->push_back(rf->get_last_fence_release());
                if (!rf->is_rmw())
-                       break;                                                                  /* End of RMW chain */
+                       break;/* End of RMW chain */
 
                /** @todo Need to be smarter here...  In the linux lock
                 * example, this will run to the beginning of the program for
@@ -1081,12 +1081,12 @@ bool ModelExecution::release_seq_heads(const ModelAction *rf,
 
                /* acq_rel RMW is a sufficient stopping condition */
                if (rf->is_acquire() && rf->is_release())
-                       return true;                                                                    /* complete */
+                       return true;/* complete */
        };
-       ASSERT(rf);                             // Needs to be real write
+       ASSERT(rf);     // Needs to be real write
 
        if (rf->is_release())
-               return true;                                            /* complete */
+               return true;/* complete */
 
        /* else relaxed write
         * - check for fence-release in the same thread (29.8, stmt. 3)
@@ -1099,7 +1099,7 @@ bool ModelExecution::release_seq_heads(const ModelAction *rf,
        if (fence_release)
                release_heads->push_back(fence_release);
 
-       return true;                    /* complete */
+       return true;    /* complete */
 }
 
 /**
@@ -1225,7 +1225,7 @@ ModelAction * ModelExecution::get_last_seq_cst_write(ModelAction *curr) const
        action_list_t::reverse_iterator rit;
        for (rit = list->rbegin();(*rit) != curr;rit++)
                ;
-       rit++;                  /* Skip past curr */
+       rit++;  /* Skip past curr */
        for ( ;rit != list->rend();rit++)
                if ((*rit)->is_write() && (*rit)->is_seqcst())
                        return *rit;
@@ -1618,7 +1618,7 @@ Thread * ModelExecution::take_step(ModelAction *curr)
        Thread *curr_thrd = get_thread(curr);
        ASSERT(curr_thrd->get_state() == THREAD_READY);
 
-       ASSERT(check_action_enabled(curr));                             /* May have side effects? */
+       ASSERT(check_action_enabled(curr));     /* May have side effects? */
        curr = check_current_action(curr);
        ASSERT(curr);
 
index 9ad7469af605755094d7213b7118396c42b7c5d3..950d6335c6dbb83f8aed88c6d5aa37face17d8d6 100644 (file)
@@ -211,4 +211,4 @@ private:
        Thread * action_select_next_thread(const ModelAction *curr) const;
 };
 
-#endif/* __EXECUTION_H__ */
+#endif /* __EXECUTION_H__ */
index ce130446f8455f19e6adfe6e7512311e5e7b7def..b92981119ec5132a00da44348ac5695f104cc31a 100644 (file)
--- a/futex.cc
+++ b/futex.cc
@@ -66,5 +66,5 @@ namespace std _GLIBCXX_VISIBILITY(default)
 
        _GLIBCXX_END_NAMESPACE_VERSION
 }
-#endif// defined(_GLIBCXX_HAVE_LINUX_FUTEX) && ATOMIC_INT_LOCK_FREE > 1
-#endif// _GLIBCXX_HAS_GTHREADS
+#endif // defined(_GLIBCXX_HAVE_LINUX_FUTEX) && ATOMIC_INT_LOCK_FREE > 1
+#endif // _GLIBCXX_HAS_GTHREADS
index 22c9022135a1b0bf85183b402b9cc0a5cb984e15..019bee798352e4cb4969a8ea41f8ca3746766027 100644 (file)
@@ -61,7 +61,7 @@ public:
                capacitymask = initialcapacity - 1;
 
                threshold = (unsigned int)(initialcapacity * loadfactor);
-               size = 0;                                                       // Initial number of elements in the hash
+               size = 0;       // Initial number of elements in the hash
        }
 
        /** @brief Hash table destructor */
@@ -183,7 +183,7 @@ public:
                        exit(EXIT_FAILURE);
                }
 
-               table = newtable;                                                                                       // Update the global hashtable upon resize()
+               table = newtable;       // Update the global hashtable upon resize()
                capacity = newsize;
                capacitymask = newsize - 1;
 
@@ -207,7 +207,7 @@ public:
                        search->val = bin->val;
                }
 
-               _free(oldtable);                                                                                                // Free the memory of the old hash table
+               _free(oldtable);        // Free the memory of the old hash table
        }
 
 private:
@@ -219,4 +219,4 @@ private:
        double loadfactor;
 };
 
-#endif/* __HASHTABLE_H__ */
+#endif /* __HASHTABLE_H__ */
diff --git a/main.cc b/main.cc
index 9375ac0d80e0a86aa72014d75972b712704372b2..dd0722b9b4416ee0d5fbd6712cd764c6f2eedc88 100644 (file)
--- a/main.cc
+++ b/main.cc
@@ -92,7 +92,7 @@ static void parse_options(struct model_params *params, int argc, char **argv)
                {"analysis", required_argument, NULL, 't'},
                {"options", required_argument, NULL, 'o'},
                {"maxexecutions", required_argument, NULL, 'x'},
-               {0, 0, 0, 0}                                            /* Terminator */
+               {0, 0, 0, 0}    /* Terminator */
        };
        int opt, longindex;
        bool error = false;
@@ -121,7 +121,7 @@ static void parse_options(struct model_params *params, int argc, char **argv)
                                error = true;
                }
                break;
-               default:                                                /* '?' */
+               default:        /* '?' */
                        error = true;
                        break;
                }
index 1d55182db6fef9ffae6a8b6334b7f8ada58fecda..84a60a510456fbea7cd6f0e4e6df87499c40ee48 100644 (file)
--- a/model.cc
+++ b/model.cc
@@ -368,7 +368,7 @@ void ModelChecker::run()
 
        for(int exec = 0;exec < params.maxexecutions;exec++) {
                thrd_t user_thread;
-               Thread *t = new Thread(execution->get_next_id(), &user_thread, &user_main_wrapper, NULL, NULL);                                                 // L: user_main_wrapper passes the user program
+               Thread *t = new Thread(execution->get_next_id(), &user_thread, &user_main_wrapper, NULL, NULL); // L: user_main_wrapper passes the user program
                execution->add_thread(t);
                //Need to seed random number generator, otherwise its state gets reset
                do {
@@ -383,7 +383,7 @@ void ModelChecker::run()
                                thread_id_t tid = int_to_id(i);
                                Thread *thr = get_thread(tid);
                                if (!thr->is_model_thread() && !thr->is_complete() && !thr->get_pending()) {
-                                       switch_from_master(thr);                                                                                                                                                        // L: context swapped, and action type of thr changed.
+                                       switch_from_master(thr);        // L: context swapped, and action type of thr changed.
                                        if (thr->is_waiting_on(thr))
                                                assert_bug("Deadlock detected (thread %u)", i);
                                }
diff --git a/model.h b/model.h
index 95fc6abebe752050dbeb81b0116ba6612ff3fa80..2a505c3d0251064710a85f1b75aca17d912bd23e 100644 (file)
--- a/model.h
+++ b/model.h
@@ -21,11 +21,11 @@ typedef SnapList<ModelAction *> action_list_t;
 
 /** @brief Model checker execution stats */
 struct execution_stats {
-       int num_total;                  /**< @brief Total number of executions */
-       int num_infeasible;                             /**< @brief Number of infeasible executions */
-       int num_buggy_executions;                               /** @brief Number of buggy executions */
-       int num_complete;                               /**< @brief Number of feasible, non-buggy, complete executions */
-       int num_redundant;                      /**< @brief Number of redundant, aborted executions */
+       int num_total;  /**< @brief Total number of executions */
+       int num_infeasible;     /**< @brief Number of infeasible executions */
+       int num_buggy_executions;       /** @brief Number of buggy executions */
+       int num_complete;       /**< @brief Number of feasible, non-buggy, complete executions */
+       int num_redundant;      /**< @brief Number of redundant, aborted executions */
 };
 
 /** @brief The central structure for model-checking */
@@ -104,4 +104,4 @@ private:
 
 extern ModelChecker *model;
 
-#endif/* __MODEL_H__ */
+#endif /* __MODEL_H__ */
index eff66348e7b9cd0e71a5321fe8cf6b15d9397683..f7b716247e3965d5b2c2f3e255846b60aeda01c5 100644 (file)
@@ -273,4 +273,4 @@ void Thread_free(void *ptr)
        free(ptr);
 }
 
-#endif/* !USE_MPROTECT_SNAPSHOT */
+#endif /* !USE_MPROTECT_SNAPSHOT */
index aaf54c395742dcb10a29f4027e04422d3b1bb0d5..14b945ab755f1c9f038dd741ca7990a9ade118ea 100644 (file)
@@ -24,7 +24,7 @@
        void operator delete[](void *p, size_t size) { \
                model_free(p); \
        } \
-       void * operator new(size_t size, void *p) {                             /* placement new */ \
+       void * operator new(size_t size, void *p) {     /* placement new */ \
                return p; \
        }
 
@@ -43,7 +43,7 @@
        void operator delete[](void *p, size_t size) { \
                snapshot_free(p); \
        } \
-       void * operator new(size_t size, void *p) {                             /* placement new */ \
+       void * operator new(size_t size, void *p) {     /* placement new */ \
                return p; \
        }
 
@@ -264,4 +264,4 @@ extern mspace model_snapshot_space;
 };     /* end of extern "C" */
 #endif
 
-#endif/* _MY_MEMORY_H */
+#endif /* _MY_MEMORY_H */
index c5e6d415d2d7fa6bb9579efeaaa44b5f7d36cf63..fa356d0e9ae666db61bb993423b7b915df2c815b 100644 (file)
@@ -80,4 +80,4 @@ private:
        int head_idx;
 };
 
-#endif/* __NODESTACK_H__ */
+#endif /* __NODESTACK_H__ */
index 53afb2c5972e13b1a4964a45c8ef00c39e5fdf0f..b51c1de5b4c987db01e1c40e134a67ac06e6783a 100644 (file)
--- a/output.h
+++ b/output.h
@@ -15,6 +15,6 @@ static inline void print_program_output() { }
 void redirect_output();
 void clear_program_output();
 void print_program_output();
-#endif/* ! CONFIG_DEBUG */
+#endif /* ! CONFIG_DEBUG */
 
-#endif/* __OUTPUT_H__ */
+#endif /* __OUTPUT_H__ */
index 597ce1ca67c85e95c91668a042d4df01dfed577d..c190066bec52a5593f48d436989ba5febd85d39a 100644 (file)
--- a/params.h
+++ b/params.h
@@ -19,4 +19,4 @@ struct model_params {
        char **argv;
 };
 
-#endif/* __PARAMS_H__ */
+#endif /* __PARAMS_H__ */
index f0f968489d4857c86f60b5ee13972d735fada982..8c2bc076f3024edbc9042d428385b3dd36f77bc2 100644 (file)
@@ -44,7 +44,7 @@ int pthread_join(pthread_t t, void **value_ptr) {
 void pthread_exit(void *value_ptr) {
        Thread * th = thread_current();
        model->switch_to_master(new ModelAction(THREAD_FINISH, std::memory_order_seq_cst, th));
-       while(1) ;                      //make warning goaway
+       while(1) ;//make warning goaway
 }
 
 int pthread_mutex_init(pthread_mutex_t *p_mutex, const pthread_mutexattr_t *) {
index f26a1a6a133b569ed25c72141545ae061fbdb9b2..59a6e3a44d250be8cdb0bbc217f50cade4ef2cce 100644 (file)
@@ -212,7 +212,7 @@ Thread * Scheduler::select_next_thread(Node *n)
        }
 
        if (avail_threads == 0)
-               return NULL;                            // No threads availablex
+               return NULL;// No threads availablex
 
        Thread * thread = execution->getFuzzer()->selectThread(n, thread_list, avail_threads);
        curr_thread_index = id_to_int(thread->get_id());
index 16ddb341e64e9b96830740af38f5dc1e2dee97aa..49bd41f308d7d82a5c174ead184f19f971c8d999 100644 (file)
@@ -55,4 +55,4 @@ private:
        Thread *current;
 };
 
-#endif/* __SCHEDULE_H__ */
+#endif /* __SCHEDULE_H__ */
index 826046f0341e80d5ab5384ba46adb0a2d47312d7..ca54c785385bb85b0fa68ada3267c933dd9ca8f0 100644 (file)
@@ -40,8 +40,8 @@ struct BackingPageRecord {
 
 /* Struct for each memory region */
 struct MemoryRegion {
-       void *basePtr;                  // base of memory region
-       int sizeInPages;                        // size of memory region in pages
+       void *basePtr;  // base of memory region
+       int sizeInPages;        // size of memory region in pages
 };
 
 /** ReturnPageAlignedAddress returns a page aligned address for the
@@ -57,19 +57,19 @@ struct mprot_snapshotter {
        mprot_snapshotter(unsigned int numbackingpages, unsigned int numsnapshots, unsigned int nummemoryregions);
        ~mprot_snapshotter();
 
-       struct MemoryRegion *regionsToSnapShot;                         //This pointer references an array of memory regions to snapshot
-       snapshot_page_t *backingStore;                  //This pointer references an array of snapshotpage's that form the backing store
-       void *backingStoreBasePtr;                      //This pointer references an array of snapshotpage's that form the backing store
-       struct BackingPageRecord *backingRecords;                               //This pointer references an array of backingpagerecord's (same number of elements as backingstore
-       struct SnapShotRecord *snapShots;                               //This pointer references the snapshot array
+       struct MemoryRegion *regionsToSnapShot; //This pointer references an array of memory regions to snapshot
+       snapshot_page_t *backingStore;  //This pointer references an array of snapshotpage's that form the backing store
+       void *backingStoreBasePtr;      //This pointer references an array of snapshotpage's that form the backing store
+       struct BackingPageRecord *backingRecords;       //This pointer references an array of backingpagerecord's (same number of elements as backingstore
+       struct SnapShotRecord *snapShots;       //This pointer references the snapshot array
 
-       unsigned int lastSnapShot;                      //Stores the next snapshot record we should use
-       unsigned int lastBackingPage;                           //Stores the next backingpage we should use
-       unsigned int lastRegion;                        //Stores the next memory region to be used
+       unsigned int lastSnapShot;      //Stores the next snapshot record we should use
+       unsigned int lastBackingPage;   //Stores the next backingpage we should use
+       unsigned int lastRegion;        //Stores the next memory region to be used
 
-       unsigned int maxRegions;                        //Stores the max number of memory regions we support
-       unsigned int maxBackingPages;                           //Stores the total number of backing pages
-       unsigned int maxSnapShots;                      //Stores the total number of snapshots we allow
+       unsigned int maxRegions;        //Stores the max number of memory regions we support
+       unsigned int maxBackingPages;   //Stores the total number of backing pages
+       unsigned int maxSnapShots;      //Stores the total number of snapshots we allow
 
        MEMALLOC
 };
@@ -114,7 +114,7 @@ static void mprot_handle_pf(int sig, siginfo_t *si, void *unused)
        }
        void* addr = ReturnPageAlignedAddress(si->si_addr);
 
-       unsigned int backingpage = mprot_snap->lastBackingPage++;                               //Could run out of pages...
+       unsigned int backingpage = mprot_snap->lastBackingPage++;       //Could run out of pages...
        if (backingpage == mprot_snap->maxBackingPages) {
                model_print("Out of backing pages at %p\n", si->si_addr);
                exit(EXIT_FAILURE);
@@ -167,7 +167,7 @@ static void mprot_snapshot_init(unsigned int numbackingpages,
        memset(&si, 0, sizeof(si));
        si.si_addr = ss.ss_sp;
        mprot_handle_pf(SIGSEGV, &si, NULL);
-       mprot_snap->lastBackingPage--;                  //remove the fake page we copied
+       mprot_snap->lastBackingPage--;  //remove the fake page we copied
 
        void *basemySpace = model_malloc((numheappages + 1) * PAGESIZE);
        void *pagealignedbase = PageAlignAddressUpward(basemySpace);
@@ -243,12 +243,12 @@ static void mprot_roll_back(snapshot_id theID)
        }
        mprot_snap->lastSnapShot = theID;
        mprot_snap->lastBackingPage = mprot_snap->snapShots[theID].firstBackingPage;
-       mprot_take_snapshot();                  //Make sure current snapshot is still good...All later ones are cleared
+       mprot_take_snapshot();  //Make sure current snapshot is still good...All later ones are cleared
 }
 
 #else  /* !USE_MPROTECT_SNAPSHOT */
 
-#define SHARED_MEMORY_DEFAULT  (100 * ((size_t)1 << 20))// 100mb for the shared memory
+#define SHARED_MEMORY_DEFAULT  (100 * ((size_t)1 << 20))       // 100mb for the shared memory
 #define STACK_SIZE_DEFAULT      (((size_t)1 << 20) * 20)       // 20 mb out of the above 100 mb for my stack
 
 struct fork_snapshotter {
@@ -424,7 +424,7 @@ static void fork_roll_back(snapshot_id theID)
        fork_snap->mIDToRollback = -1;
 }
 
-#endif/* !USE_MPROTECT_SNAPSHOT */
+#endif /* !USE_MPROTECT_SNAPSHOT */
 
 /**
  * @brief Initializes the snapshot system
index 6444c41881fa4519222b0309d5ced73615539640..2430818a0cda6582bc044f1f80166b088ac74d80 100644 (file)
@@ -67,7 +67,7 @@ static inline void print_stacktrace(int fd = STDERR_FILENO, unsigned int max_fra
                        char* ret = abi::__cxa_demangle(begin_name,
                                                                                                                                                        funcname, &funcnamesize, &status);
                        if (status == 0) {
-                               funcname = ret;                                                                                                 // use possibly realloc()-ed string
+                               funcname = ret; // use possibly realloc()-ed string
                                dprintf(fd, "  %s : %s+%s\n",
                                                                symbollist[i], funcname, begin_offset);
                        } else {
@@ -91,4 +91,4 @@ static inline void print_stacktrace(FILE *out, unsigned int max_frames = 63)
        print_stacktrace(fileno(out), max_frames);
 }
 
-#endif// __STACKTRACE_H__
+#endif // __STACKTRACE_H__
index 9fa7cf9f3b64bac31c9c10a80f37da4a5ae1a2a9..300cbd045ad6bc7c6b808d1b83ccc77a47511f26 100644 (file)
@@ -73,4 +73,4 @@ public:
        SNAPSHOTALLOC
 };
 
-#endif/* __STL_MODEL_H__ */
+#endif /* __STL_MODEL_H__ */
index ad178329eec4b38ce5042de6936e9e5f0d516ea2..61e3569bbdfe8a9f09efb8e354eacc119257d8ab 100644 (file)
@@ -187,4 +187,4 @@ static inline int id_to_int(thread_id_t id)
        return id;
 }
 
-#endif/* __THREADS_MODEL_H__ */
+#endif /* __THREADS_MODEL_H__ */
index b87ae4e4488356764aa4974a261a8ed84ac09577..67f681ca7052538afb794ff87bb9708ff3655daa 100644 (file)
@@ -143,7 +143,7 @@ Thread::Thread(thread_id_t tid) :
        stack(NULL),
        user_thread(NULL),
        id(tid),
-       state(THREAD_READY),                    /* Thread is always ready? */
+       state(THREAD_READY),    /* Thread is always ready? */
        last_action_val(0),
        model_thread(true)
 {
@@ -176,7 +176,7 @@ Thread::Thread(thread_id_t tid, thrd_t *t, void (*func)(void *), void *a, Thread
        if (ret)
                model_print("Error in create_context\n");
 
-       user_thread->priv = this;                               // WL
+       user_thread->priv = this;       // WL
 }
 
 /**