From: bdemsky Date: Wed, 12 Jun 2019 20:25:50 +0000 (-0700) Subject: fix tabbing comment issue X-Git-Url: http://plrg.eecs.uci.edu/git/?p=c11tester.git;a=commitdiff_plain;h=995962127d29a128fa2de578f47953308600b605 fix tabbing comment issue --- diff --git a/C.cfg b/C.cfg index a464e72d..dc4bf83d 100644 --- 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 diff --git a/action.cc b/action.cc index d4cdb530..9c0e2992 100644 --- 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); diff --git a/action.h b/action.h index e831df80..2bde6b85 100644 --- 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__ */ diff --git a/bugmessage.h b/bugmessage.h index bab57381..eda457e0 100644 --- a/bugmessage.h +++ b/bugmessage.h @@ -18,4 +18,4 @@ struct bug_message { SNAPSHOTALLOC }; -#endif/* __BUGMESSAGE_H__ */ +#endif /* __BUGMESSAGE_H__ */ diff --git a/clockvector.h b/clockvector.h index b9987b22..430dc177 100644 --- a/clockvector.h +++ b/clockvector.h @@ -28,4 +28,4 @@ private: int num_threads; }; -#endif/* __CLOCKVECTOR_H__ */ +#endif /* __CLOCKVECTOR_H__ */ diff --git a/common.cc b/common.cc index f327d27e..904a298e 100644 --- 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 */ diff --git a/common.h b/common.h index 1b2b673f..81af7864 100644 --- 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__ */ diff --git a/config.h b/config.h index ac725c35..43c04427 100644 --- a/config.h +++ b/config.h @@ -27,7 +27,7 @@ #else #define BIT48 0 #endif -#endif/* BIT48 */ +#endif /* BIT48 */ /** Snapshotting configurables */ diff --git a/context.cc b/context.cc index d446fa76..6dc43d8a 100644 --- a/context.cc +++ b/context.cc @@ -24,4 +24,4 @@ int model_swapcontext(ucontext_t *oucp, ucontext_t *ucp) return 0; } -#endif/* MAC */ +#endif /* MAC */ diff --git a/context.h b/context.h index f0003ce4..aa356a92 100644 --- 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__ */ diff --git a/cyclegraph.cc b/cyclegraph.cc index f4590bfb..8acbb4ed 100644 --- a/cyclegraph.cc +++ b/cyclegraph.cc @@ -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 diff --git a/cyclegraph.h b/cyclegraph.h index d273279a..7a90f5cf 100644 --- a/cyclegraph.h +++ b/cyclegraph.h @@ -112,4 +112,4 @@ private: CycleNode *hasRMW; }; -#endif/* __CYCLEGRAPH_H__ */ +#endif /* __CYCLEGRAPH_H__ */ diff --git a/datarace.h b/datarace.h index ce659d1a..a83116bb 100644 --- a/datarace.h +++ b/datarace.h @@ -89,4 +89,4 @@ struct RaceRecord { #define MAXREADVECTOR (READMASK-1) #define MAXWRITEVECTOR (WRITEMASK-1) -#endif/* __DATARACE_H__ */ +#endif /* __DATARACE_H__ */ diff --git a/execution.cc b/execution.cc index f498efbb..e253ab0f 100644 --- a/execution.cc +++ b/execution.cc @@ -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); diff --git a/execution.h b/execution.h index 9ad7469a..950d6335 100644 --- a/execution.h +++ b/execution.h @@ -211,4 +211,4 @@ private: Thread * action_select_next_thread(const ModelAction *curr) const; }; -#endif/* __EXECUTION_H__ */ +#endif /* __EXECUTION_H__ */ diff --git a/futex.cc b/futex.cc index ce130446..b9298111 100644 --- 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 diff --git a/hashtable.h b/hashtable.h index 22c90221..019bee79 100644 --- a/hashtable.h +++ b/hashtable.h @@ -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 9375ac0d..dd0722b9 100644 --- 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; } diff --git a/model.cc b/model.cc index 1d55182d..84a60a51 100644 --- 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 95fc6abe..2a505c3d 100644 --- a/model.h +++ b/model.h @@ -21,11 +21,11 @@ typedef SnapList 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__ */ diff --git a/mymemory.cc b/mymemory.cc index eff66348..f7b71624 100644 --- a/mymemory.cc +++ b/mymemory.cc @@ -273,4 +273,4 @@ void Thread_free(void *ptr) free(ptr); } -#endif/* !USE_MPROTECT_SNAPSHOT */ +#endif /* !USE_MPROTECT_SNAPSHOT */ diff --git a/mymemory.h b/mymemory.h index aaf54c39..14b945ab 100644 --- a/mymemory.h +++ b/mymemory.h @@ -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 */ diff --git a/nodestack.h b/nodestack.h index c5e6d415..fa356d0e 100644 --- a/nodestack.h +++ b/nodestack.h @@ -80,4 +80,4 @@ private: int head_idx; }; -#endif/* __NODESTACK_H__ */ +#endif /* __NODESTACK_H__ */ diff --git a/output.h b/output.h index 53afb2c5..b51c1de5 100644 --- 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__ */ diff --git a/params.h b/params.h index 597ce1ca..c190066b 100644 --- a/params.h +++ b/params.h @@ -19,4 +19,4 @@ struct model_params { char **argv; }; -#endif/* __PARAMS_H__ */ +#endif /* __PARAMS_H__ */ diff --git a/pthread.cc b/pthread.cc index f0f96848..8c2bc076 100644 --- a/pthread.cc +++ b/pthread.cc @@ -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 *) { diff --git a/schedule.cc b/schedule.cc index f26a1a6a..59a6e3a4 100644 --- a/schedule.cc +++ b/schedule.cc @@ -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()); diff --git a/schedule.h b/schedule.h index 16ddb341..49bd41f3 100644 --- a/schedule.h +++ b/schedule.h @@ -55,4 +55,4 @@ private: Thread *current; }; -#endif/* __SCHEDULE_H__ */ +#endif /* __SCHEDULE_H__ */ diff --git a/snapshot.cc b/snapshot.cc index 826046f0..ca54c785 100644 --- a/snapshot.cc +++ b/snapshot.cc @@ -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 diff --git a/stacktrace.h b/stacktrace.h index 6444c418..2430818a 100644 --- a/stacktrace.h +++ b/stacktrace.h @@ -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__ diff --git a/stl-model.h b/stl-model.h index 9fa7cf9f..300cbd04 100644 --- a/stl-model.h +++ b/stl-model.h @@ -73,4 +73,4 @@ public: SNAPSHOTALLOC }; -#endif/* __STL_MODEL_H__ */ +#endif /* __STL_MODEL_H__ */ diff --git a/threads-model.h b/threads-model.h index ad178329..61e3569b 100644 --- a/threads-model.h +++ b/threads-model.h @@ -187,4 +187,4 @@ static inline int id_to_int(thread_id_t id) return id; } -#endif/* __THREADS_MODEL_H__ */ +#endif /* __THREADS_MODEL_H__ */ diff --git a/threads.cc b/threads.cc index b87ae4e4..67f681ca 100644 --- a/threads.cc +++ b/threads.cc @@ -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 } /**