remove EOL spaces, fix indentation
authorBrian Norris <banorris@uci.edu>
Wed, 11 Jul 2012 04:31:24 +0000 (21:31 -0700)
committerBrian Norris <banorris@uci.edu>
Wed, 11 Jul 2012 04:31:24 +0000 (21:31 -0700)
action.cc
action.h
clockvector.cc
datarace.cc
hashtable.h
main.cc
model.h
mymemory.cc
snapshot-interface.cc
snapshot-interface.h
snapshot.cc

index f41b0eba7643e18a912b776c71470eddf71a1bf7..44d3f8f1d9b3e701e5d38f7100611b00b6870cf8 100644 (file)
--- a/action.cc
+++ b/action.cc
@@ -101,7 +101,7 @@ bool ModelAction::is_synchronizing(const ModelAction *act) const
        // Different locations commute
        if (!same_var(act))
                return false;
-       
+
        // Explore interleavings of seqcst writes to guarantee total order
        // of seq_cst operations that don't commute
        if (is_write() && is_seqcst() && act->is_write() && act->is_seqcst())
index 111ac31124ef89d796e8d163c1b39a097c9a2c7c..00bb5c2fbdef9c2a2a77729ed16e3b386eca74c9 100644 (file)
--- a/action.h
+++ b/action.h
@@ -90,7 +90,7 @@ private:
 
        /** The thread id that performed this action. */
        thread_id_t tid;
-       
+
        /** The value read or written (if RMW, then the value written). This
         * should probably be something longer. */
        int value;
@@ -98,7 +98,7 @@ private:
        /** A back reference to a Node in NodeStack, if this ModelAction is
         * saved on the NodeStack. */
        Node *node;
-       
+
        modelclock_t seq_number;
 
        /** The clock vector stored with this action; only needed if this
index cfd99c66177568a642947c2959d87582010282c8..162a7c2550db61c3845885349a01b76e6fd84838 100644 (file)
@@ -84,7 +84,7 @@ bool ClockVector::synchronized_since(const ModelAction *act) const
        return false;
 }
 
-/** 
+/**
  * Gets the clock corresponding to a given thread id from the clock
  * vector. */
 
index 29ace0ad5122c4b584fab9504538c951e73b6f68..5a23d82d5d97d865f486a9ebbd2913b93e9230f9 100644 (file)
@@ -45,7 +45,7 @@ static bool clock_may_race(ClockVector *clock1, thread_id_t tid1,
        return tid1 != tid2 && clock2 != 0 && clock1->getClock(tid2) <= clock2;
 }
 
-/** 
+/**
  * Expands a record from the compact form to the full form.  This is
  * necessary for multiple readers or for very large thread ids or time
  * stamps. */
index b544988ebb187d7ea015940025dce76e573d5a9b..b1cd3273290a47e94d0c3000c06e88a43e2cb97d 100644 (file)
@@ -48,14 +48,14 @@ template<typename _Key, typename _Val, typename _KeyInt, int _Shift>
                memset(table, 0, capacity*sizeof(struct hashlistnode<_Key, _Val> *));
                size=0;
        }
-       
+
        void put(_Key key, _Val val) {
                if(size > threshold) {
                        //Resize
                        unsigned int newsize = capacity << 1;
                        resize(newsize);
                }
-               
+
                struct hashlistnode<_Key,_Val> *ptr = table[(((_KeyInt)key) & mask)>>_Shift];
                size++;
                struct hashlistnode<_Key,_Val> *search = ptr;
@@ -77,7 +77,7 @@ template<typename _Key, typename _Val, typename _KeyInt, int _Shift>
 
        _Val get(_Key key) {
                struct hashlistnode<_Key,_Val> *search = table[(((_KeyInt)key) & mask)>>_Shift];
-               
+
                while(search!=NULL) {
                        if (search->key==key) {
                                return search->val;
@@ -89,7 +89,7 @@ template<typename _Key, typename _Val, typename _KeyInt, int _Shift>
 
        bool contains(_Key key) {
                struct hashlistnode<_Key,_Val> *search = table[(((_KeyInt)key) & mask)>>_Shift];
-               
+
                while(search!=NULL) {
                        if (search->key==key) {
                                return true;
@@ -98,29 +98,29 @@ template<typename _Key, typename _Val, typename _KeyInt, int _Shift>
                }
                return false;
        }
-       
+
        void resize(unsigned int newsize) {
                struct hashlistnode<_Key,_Val> ** oldtable = table;
                struct hashlistnode<_Key,_Val> ** newtable;
                unsigned int oldcapacity = capacity;
-               
+
                if((newtable = (struct hashlistnode<_Key,_Val> **) calloc(newsize, sizeof(struct hashlistnode<_Key,_Val> *))) == NULL) {
                        printf("Calloc error %s %d\n", __FILE__, __LINE__);
                        exit(-1);
                }
-               
+
                table = newtable;          //Update the global hashtable upon resize()
                capacity = newsize;
                threshold = (unsigned int) (newsize * loadfactor);
                mask = (newsize << _Shift)-1;
-               
+
                for(unsigned int i = 0; i < oldcapacity; i++) {
                        struct hashlistnode<_Key, _Val> * bin = oldtable[i];
-                       
+
                        while(bin!=NULL) {
                                _Key key=bin->key;
                                struct hashlistnode<_Key, _Val> * next=bin->next;
-                               
+
                                unsigned int index = (((_KeyInt)key) & mask) >>_Shift;
                                struct hashlistnode<_Key, _Val> * tmp=newtable[index];
                                bin->next=tmp;
@@ -128,10 +128,10 @@ template<typename _Key, typename _Val, typename _KeyInt, int _Shift>
                                bin = next;
                        }
                }
-               
+
                free(oldtable);            //Free the memory of the old hash table
        }
-       
+
  private:
        struct hashlistnode<_Key,_Val> **table;
        unsigned int capacity;
diff --git a/main.cc b/main.cc
index a400fe3c2defff0eafc93e812b005f6b2b6fcf69..19f12f182494685d718a963b23ee01d3ef3ffcb0 100644 (file)
--- a/main.cc
+++ b/main.cc
@@ -56,8 +56,9 @@ static void thread_wait_finish(void) {
 void real_main() {
        thrd_t user_thread;
        ucontext_t main_context;
-  //Initialize race detector
-  initRaceDetector();
+
+       //Initialize race detector
+       initRaceDetector();
 
        //Create the singleton SnapshotStack object
        snapshotObject = new SnapshotStack();
diff --git a/model.h b/model.h
index 97e9849f0bbb441c5af72999e3453bc9adbe5745..941601b61fba027fe9b4a3dc366eef420aa561e1 100644 (file)
--- a/model.h
+++ b/model.h
@@ -1,5 +1,5 @@
 /** @file model.h
- *  @brief Core model checker. 
+ *  @brief Core model checker.
  */
 
 #ifndef __MODEL_H__
index 88018e269093c531a67bde16d27de8a95d6d6305..f3464fc6bff4927e6f1b36d5678b062a1b87519b 100644 (file)
@@ -20,7 +20,7 @@ void *MYMALLOC(size_t size) {
        static void *(*mallocp)(size_t size);
        char *error;
        void *ptr;
-  
+
        /* get address of libc malloc */
        if (!mallocp) {
                mallocp = ( void * ( * )( size_t ) )dlsym(RTLD_NEXT, "malloc");
@@ -29,7 +29,7 @@ void *MYMALLOC(size_t size) {
                        exit(EXIT_FAILURE);
                }
        }
-       ptr = mallocp(size);     
+       ptr = mallocp(size);
        return ptr;
 #else
        if( !sTheRecord ){
index baedf4753a806b5ac47b8079f9227dba4bce3706..fbbc67772b832bb889555ab40907b7e39173d45c 100644 (file)
@@ -56,7 +56,7 @@ static void SnapshotGlobalSegments(){
                //Skip out at the end of the section
                if (buf[0]=='\n')
                        break;
-               
+
                sscanf(buf, "%22s %p-%p [%5dK] %c%c%c/%c%c%c SM=%3s %200s\n", &type, &begin, &end, &size, &r, &w, &x, &mr, &mw, &mx, smstr, regionname);
 
                if (w == 'w' && (strstr(regionname, MYBINARYNAME) || strstr(regionname, MYLIBRARYNAME))) {
@@ -113,11 +113,11 @@ SnapshotStack::~SnapshotStack(){
 
 /** This method returns to the last snapshot before the inputted
  * sequence number.  This function must be called from the model
- * checking thread and not from a snapshotted stack.  
- * @param seqindex is the sequence number to rollback before.  
+ * checking thread and not from a snapshotted stack.
+ * @param seqindex is the sequence number to rollback before.
  * @return is the sequence number we actually rolled back to.
  */
-               
+
 int SnapshotStack::backTrackBeforeStep(int seqindex) {
        while(true) {
                if (stack->index<=seqindex) {
index 5f54edb87f00f3299c20b1dc7beb9b5f4149107d..9912a1b78f2beba07c08b624b483c71492fd9e3a 100644 (file)
@@ -28,7 +28,7 @@ class SnapshotStack {
   int backTrackBeforeStep(int seq_index);
   void snapshotStep(int seq_index);
 
- private: 
+ private:
   struct stackEntry * stack;
 };
 
index 1e7d80b4b5d836d1c4a1cdb653824a626afb82c8..b6e20fd7691a037bab3e5d83b30b860dc6ab713c 100644 (file)
@@ -34,7 +34,7 @@ struct Snapshot * sTheRecord = NULL;
 
 #if !USE_MPROTECT_SNAPSHOT
 /** @statics
-*   These variables are necessary because the stack is shared region and 
+*   These variables are necessary because the stack is shared region and
 *   there exists a race between all processes executing the same function.
 *   To avoid the problem above, we require variables allocated in 'safe' regions.
 *   The bug was actually observed with the forkID, these variables below are
@@ -66,7 +66,7 @@ static void * ReturnPageAlignedAddress(void * addr) {
 }
 
 /** The initSnapShotRecord method initialized the snapshotting data
- *  structures for the mprotect based snapshot. 
+ *  structures for the mprotect based snapshot.
  */
 static void initSnapShotRecord(unsigned int numbackingpages, unsigned int numsnapshots, unsigned int nummemoryregions) {
        snapshotrecord=( struct SnapShot * )MYMALLOC(sizeof(struct SnapShot));
@@ -235,7 +235,7 @@ void initSnapShotLibrary(unsigned int numbackingpages,
 #endif
 }
 
-/** The addMemoryRegionToSnapShot function assumes that addr is page aligned. 
+/** The addMemoryRegionToSnapShot function assumes that addr is page aligned.
  */
 void addMemoryRegionToSnapShot( void * addr, unsigned int numPages) {
 #if USE_MPROTECT_SNAPSHOT
@@ -310,7 +310,7 @@ void rollBack( snapshot_id theID ){
        getcontext( &sTheRecord->mContextToRollback );
        /*
        * This is used to quit the process on rollback, so that
-       * the process which needs to rollback can quit allowing the process whose snapshotid matches the rollbackid to switch to 
+       * the process which needs to rollback can quit allowing the process whose snapshotid matches the rollbackid to switch to
        * this context and continue....
        */
        if( !sTemp ){