reformat some doxygen comments, remove newlines
authorBrian Norris <banorris@uci.edu>
Thu, 12 Jul 2012 20:56:15 +0000 (13:56 -0700)
committerBrian Norris <banorris@uci.edu>
Thu, 12 Jul 2012 22:25:38 +0000 (15:25 -0700)
Avoiding newlines between a comment and its function header makes it more
obvious which function the comment belongs to.

clockvector.cc
cyclegraph.cc
datarace.cc
main.cc
mymemory.cc
mymemory.h
snapshot-interface.cc

index 190f9216a92b61ad68df0990775d4c978aaa53f9..6c6e2fa579e606377ec45bed18bddac8d357cbb8 100644 (file)
@@ -84,10 +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. */
-
+/** Gets the clock corresponding to a given thread id from the clock vector. */
 modelclock_t ClockVector::getClock(thread_id_t thread) {
        int threadid = id_to_int(thread);
 
index 324e01cc0312747e4b39ee4b6c37343cfd7d163f..dad8b7acb6975b0caccc1887394788b9f9dfff04 100644 (file)
@@ -2,13 +2,11 @@
 #include "action.h"
 
 /** Initializes a CycleGraph object. */
-
 CycleGraph::CycleGraph() {
        hasCycles=false;
 }
 
 /** Returns the CycleNode for a given ModelAction. */
-
 CycleNode * CycleGraph::getNode(ModelAction * action) {
        CycleNode *node=actionToNode.get(action);
        if (node==NULL) {
@@ -19,7 +17,6 @@ CycleNode * CycleGraph::getNode(ModelAction * action) {
 }
 
 /** Adds an edge between two ModelActions. */
-
 void CycleGraph::addEdge(ModelAction *from, ModelAction *to) {
        CycleNode *fromnode=getNode(from);
        CycleNode *tonode=getNode(to);
@@ -31,7 +28,6 @@ void CycleGraph::addEdge(ModelAction *from, ModelAction *to) {
 }
 
 /** Checks whether the first CycleNode can reach the second one. */
-
 bool CycleGraph::checkReachable(CycleNode *from, CycleNode *to) {
        std::vector<CycleNode *> queue;
        HashTable<CycleNode *, CycleNode *, uintptr_t, 4> discovered;
@@ -61,19 +57,16 @@ bool CycleGraph::checkForCycles() {
 }
 
 /** Constructor for a CycleNode. */
-
 CycleNode::CycleNode(ModelAction *modelaction) {
        action=modelaction;
 }
 
 /** Returns a vector of the edges from a CycleNode. */
-
 std::vector<CycleNode *> * CycleNode::getEdges() {
        return &edges;
 }
 
 /** Adds an edge to a CycleNode. */
-
 void CycleNode::addEdge(CycleNode * node) {
        edges.push_back(node);
 }
index 5a23d82d5d97d865f486a9ebbd2913b93e9230f9..294b6b919ad224b8c6633491555db1d6c132c002 100644 (file)
@@ -6,14 +6,12 @@
 struct ShadowTable *root;
 
 /** This function initialized the data race detector. */
-
 void initRaceDetector() {
        root=(struct ShadowTable *) calloc(sizeof(struct ShadowTable),1);
 }
 
-/** This function looks up the entry in the shadow table corresponding
-               to a given address.*/
-
+/** This function looks up the entry in the shadow table corresponding to a
+ * given address.*/
 static uint64_t * lookupAddressEntry(void * address) {
        struct ShadowTable *currtable=root;
 #ifdef BIT48
@@ -49,7 +47,6 @@ static bool clock_may_race(ClockVector *clock1, thread_id_t tid1,
  * 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. */
-
 static void expandRecord(uint64_t * shadow) {
        uint64_t shadowval=*shadow;
 
@@ -74,14 +71,11 @@ static void expandRecord(uint64_t * shadow) {
 }
 
 /** This function is called when we detect a data race.*/
-
 static void reportDataRace() {
        printf("The reportDataRace method should report useful things about this datarace!\n");
 }
 
-/** This function does race detection for a write on an expanded
- *             record. */
-
+/** This function does race detection for a write on an expanded record. */
 void fullRaceCheckWrite(thread_id_t thread, uint64_t * shadow, ClockVector *currClock) {
        struct RaceRecord * record=(struct RaceRecord *) (*shadow);
 
@@ -116,9 +110,7 @@ void fullRaceCheckWrite(thread_id_t thread, uint64_t * shadow, ClockVector *curr
        record->writeClock=ourClock;
 }
 
-/** This function does race detection on a write.
- */
-
+/** This function does race detection on a write. */
 void raceCheckWrite(thread_id_t thread, void *location, ClockVector *currClock) {
        uint64_t * shadow=lookupAddressEntry(location);
        uint64_t shadowval=*shadow;
@@ -161,9 +153,7 @@ void raceCheckWrite(thread_id_t thread, void *location, ClockVector *currClock)
        *shadow = ENCODEOP(0, 0, threadid, ourClock);
 }
 
-/** This function does race detection on a read for an expanded
- *     record. */
-
+/** This function does race detection on a read for an expanded record. */
 void fullRaceCheckRead(thread_id_t thread, uint64_t * shadow, ClockVector *currClock) {
        struct RaceRecord * record=(struct RaceRecord *) (*shadow);
 
@@ -222,7 +212,6 @@ void fullRaceCheckRead(thread_id_t thread, uint64_t * shadow, ClockVector *currC
 }
 
 /** This function does race detection on a read. */
-
 void raceCheckRead(thread_id_t thread, void *location, ClockVector *currClock) {
        uint64_t * shadow=lookupAddressEntry(location);
        uint64_t shadowval=*shadow;
diff --git a/main.cc b/main.cc
index c9ac1d0663206feccb6d05d43803689e7214574e..339b85efd45d427096546cbf8641d3afbb71067f 100644 (file)
--- a/main.cc
+++ b/main.cc
 #include "model.h"
 #include "snapshot-interface.h"
 
-/** The thread_system_next function takes the next step in the
- *  execution.  @return Returns the 1 if there is another step and 0
- *  otherwise.
+/**
+ * The thread_system_next function takes the next step in the execution.
+ * @return Returns the 1 if there is another step and 0 otherwise.
  */
-
 static int thread_system_next(void) {
        Thread *curr, *next;
 
@@ -43,7 +42,6 @@ static int thread_system_next(void) {
 /** The thread_wait_finish method runs the current execution until we
  *  have no more steps to take.
  */
-
 static void thread_wait_finish(void) {
        DBG();
 
@@ -52,7 +50,6 @@ static void thread_wait_finish(void) {
 
 
 /** The real_main function contains the main model checking loop. */
-
 static void real_main() {
        thrd_t user_thread;
        ucontext_t main_context;
index f3464fc6bff4927e6f1b36d5678b062a1b87519b..fcc98db547e67633bb8b0c665327f3402edfdea0 100644 (file)
@@ -14,7 +14,6 @@ static mspace sStaticSpace = NULL;
 #endif
 
 /** Non-snapshotting malloc for our use. */
-
 void *MYMALLOC(size_t size) {
 #if USE_MPROTECT_SNAPSHOT
        static void *(*mallocp)(size_t size);
@@ -102,7 +101,6 @@ void * basemySpace = NULL;
 
 /** Adding the fix for not able to allocate through a reimplemented calloc at the beginning before instantiating our allocator
 A bit circumspect about adding an sbrk. linux docs say to avoid using it... */
-
 void * HandleEarlyAllocationRequest( size_t sz ){
        if( 0 == mySpace ){
                void * returnAddress = sbrk( sz );
@@ -116,7 +114,6 @@ void * HandleEarlyAllocationRequest( size_t sz ){
 }
 
 /** The fact that I am not expecting more than a handful requests is implicit in my not using a binary search here*/
-
 bool DontFree( void * ptr ){
        if( howManyFreed == nextRequest ) return false; //a minor optimization to reduce the number of instructions executed on each free call....
        if( NULL == ptr ) return true;
@@ -130,7 +127,6 @@ bool DontFree( void * ptr ){
 }
 
 /** Snapshotting malloc implementation for user programs. */
-
 void *malloc( size_t size ) {
        void * earlyReq = HandleEarlyAllocationRequest( size );
        if( earlyReq ) return earlyReq;
@@ -138,20 +134,17 @@ void *malloc( size_t size ) {
 }
 
 /** Snapshotting free implementation for user programs. */
-
 void free( void * ptr ){
        if( DontFree( ptr ) ) return;
        mspace_free( mySpace, ptr );
 }
 
 /** Snapshotting realloc implementation for user programs. */
-
 void *realloc( void *ptr, size_t size ){
        return mspace_realloc( mySpace, ptr, size );
 }
 
 /** Snapshotting calloc implementation for user programs. */
-
 void * calloc( size_t num, size_t size ){
        void * earlyReq = HandleEarlyAllocationRequest( size * num );
        if( earlyReq ) {
@@ -162,25 +155,21 @@ void * calloc( size_t num, size_t size ){
 }
 
 /** Snapshotting new operator for user programs. */
-
 void * operator new(size_t size) throw(std::bad_alloc) {
        return malloc(size);
 }
 
 /** Snapshotting delete operator for user programs. */
-
 void operator delete(void *p) throw() {
        free(p);
 }
 
 /** Snapshotting new[] operator for user programs. */
-
 void * operator new[](size_t size) throw(std::bad_alloc) {
        return malloc(size);
 }
 
 /** Snapshotting delete[] operator for user programs. */
-
 void operator delete[](void *p, size_t size) {
        free(p);
 }
index 56e690436d1e573da00bf287e6aff2388f476c0c..fb6df12cd6791e85b1553d3c51da3ba89e67e2e2 100644 (file)
@@ -9,7 +9,6 @@
 
 /** MEMALLOC declares the allocators for a class to allocate
  *     memory in the non-snapshotting heap. */
-
 #define MEMALLOC \
        void * operator new(size_t size) { \
                return MYMALLOC(size);\
@@ -26,7 +25,6 @@
 
 /** SNAPSHOTALLOC declares the allocators for a class to allocate
  *     memory in the snapshotting heap. */
-
 #define SNAPSHOTALLOC
 
 void *MYMALLOC(size_t size);
@@ -45,7 +43,6 @@ void *system_malloc( size_t size );
  * This software is provided "as is" without express or implied
  * warranty, and with no claim as to its suitability for any purpose.
  */
-
 template <class T>
    class MyAlloc {
      public:
index fbbc67772b832bb889555ab40907b7e39173d45c..84749f1f4b0d3a3fa2cca047dee826696eba84c9 100644 (file)
@@ -117,7 +117,6 @@ SnapshotStack::~SnapshotStack(){
  * @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) {
@@ -131,9 +130,7 @@ int SnapshotStack::backTrackBeforeStep(int seqindex) {
        }
 }
 
-/** This method takes a snapshot at the given sequence number.
- */
-
+/** This method takes a snapshot at the given sequence number. */
 void SnapshotStack::snapshotStep(int seqindex) {
        struct stackEntry *tmp=(struct stackEntry *)MYMALLOC(sizeof(struct stackEntry));
        tmp->next=stack;