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 a464e72..dc4bf83 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 d4cdb53..9c0e299 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 e831df8..2bde6b8 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 bab5738..eda457e 100644 (file)
@@ -18,4 +18,4 @@ struct bug_message {
        SNAPSHOTALLOC
 };
 
-#endif/* __BUGMESSAGE_H__ */
+#endif /* __BUGMESSAGE_H__ */
index b9987b2..430dc17 100644 (file)
@@ -28,4 +28,4 @@ private:
        int num_threads;
 };
 
-#endif/* __CLOCKVECTOR_H__ */
+#endif /* __CLOCKVECTOR_H__ */
index f327d27..904a298 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 1b2b673..81af786 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 ac725c3..43c0442 100644 (file)
--- a/config.h
+++ b/config.h
@@ -27,7 +27,7 @@
 #else
 #define BIT48 0
 #endif
-#endif/* BIT48 */
+#endif /* BIT48 */
 
 /** Snapshotting configurables */
 
index d446fa7..6dc43d8 100644 (file)
@@ -24,4 +24,4 @@ int model_swapcontext(ucontext_t *oucp, ucontext_t *ucp)
        return 0;
 }
 
-#endif/* MAC */
+#endif /* MAC */
index f0003ce..aa356a9 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 f4590bf..8acbb4e 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 d273279..7a90f5c 100644 (file)
@@ -112,4 +112,4 @@ private:
        CycleNode *hasRMW;
 };
 
-#endif/* __CYCLEGRAPH_H__ */
+#endif /* __CYCLEGRAPH_H__ */
index ce659d1..a83116b 100644 (file)
@@ -89,4 +89,4 @@ struct RaceRecord {
 #define MAXREADVECTOR (READMASK-1)
 #define MAXWRITEVECTOR (WRITEMASK-1)
 
-#endif/* __DATARACE_H__ */
+#endif /* __DATARACE_H__ */
index f498efb..e253ab0 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 9ad7469..950d633 100644 (file)
@@ -211,4 +211,4 @@ private:
        Thread * action_select_next_thread(const ModelAction *curr) const;
 };
 
-#endif/* __EXECUTION_H__ */
+#endif /* __EXECUTION_H__ */
index ce13044..b929811 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 22c9022..019bee7 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 9375ac0..dd0722b 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 1d55182..84a60a5 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 95fc6ab..2a505c3 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 eff6634..f7b7162 100644 (file)
@@ -273,4 +273,4 @@ void Thread_free(void *ptr)
        free(ptr);
 }
 
-#endif/* !USE_MPROTECT_SNAPSHOT */
+#endif /* !USE_MPROTECT_SNAPSHOT */
index aaf54c3..14b945a 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 c5e6d41..fa356d0 100644 (file)
@@ -80,4 +80,4 @@ private:
        int head_idx;
 };
 
-#endif/* __NODESTACK_H__ */
+#endif /* __NODESTACK_H__ */
index 53afb2c..b51c1de 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 597ce1c..c190066 100644 (file)
--- a/params.h
+++ b/params.h
@@ -19,4 +19,4 @@ struct model_params {
        char **argv;
 };
 
-#endif/* __PARAMS_H__ */
+#endif /* __PARAMS_H__ */
index f0f9684..8c2bc07 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 f26a1a6..59a6e3a 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 16ddb34..49bd41f 100644 (file)
@@ -55,4 +55,4 @@ private:
        Thread *current;
 };
 
-#endif/* __SCHEDULE_H__ */
+#endif /* __SCHEDULE_H__ */
index 826046f..ca54c78 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 6444c41..2430818 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 9fa7cf9..300cbd0 100644 (file)
@@ -73,4 +73,4 @@ public:
        SNAPSHOTALLOC
 };
 
-#endif/* __STL_MODEL_H__ */
+#endif /* __STL_MODEL_H__ */
index ad17832..61e3569 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 b87ae4e..67f681c 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
 }
 
 /**