From: Subramanian Ganapathy Date: Thu, 14 Jun 2012 23:13:59 +0000 (-0700) Subject: (snapshot) removing mbFinalize and usage of finalize X-Git-Url: http://plrg.eecs.uci.edu/git/?p=c11tester.git;a=commitdiff_plain;h=06c46bd5c02bb68c1a75edc4423e5281e497c6c1 (snapshot) removing mbFinalize and usage of finalize Now there is no need for finalize mechanism at all. All that was required was resetting the rollback id --- diff --git a/main.cc b/main.cc index 66ad9f1d..b38f7ef4 100644 --- a/main.cc +++ b/main.cc @@ -78,7 +78,6 @@ void real_main() { delete model; DEBUG("Exiting\n"); - finalize(); } int main_numargs; diff --git a/snapshot-interface.h b/snapshot-interface.h index 48fa2e3e..5f54edb8 100644 --- a/snapshot-interface.h +++ b/snapshot-interface.h @@ -13,7 +13,6 @@ typedef void (*VoidFuncPtr)(); void initSnapShotLibrary(unsigned int numbackingpages, unsigned int numsnapshots, unsigned int nummemoryregions, unsigned int numheappages, VoidFuncPtr entryPoint); -void finalize(); struct stackEntry { struct stackEntry *next; diff --git a/snapshot.cc b/snapshot.cc index 9a69a4b3..eeeb58c9 100644 --- a/snapshot.cc +++ b/snapshot.cc @@ -120,7 +120,6 @@ void createSharedLibrary(){ sTheRecord->mStackSize = STACK_SIZE_DEFAULT; sTheRecord->mIDToRollback = -1; sTheRecord->currSnapShotID = 0; - sTheRecord->mbFinalize = false; #endif } @@ -197,7 +196,7 @@ void initSnapShotLibrary(unsigned int numbackingpages, pid_t forkedID = 0; snapshotid = sTheRecord->currSnapShotID; bool swapContext = false; - while( !sTheRecord->mbFinalize ){ + while( true ){ sTheRecord->currSnapShotID=snapshotid+1; forkedID = fork(); if( 0 == forkedID ){ @@ -311,14 +310,7 @@ void rollBack( snapshot_id theID ){ SSDEBUG("Invoked rollback"); exit(EXIT_SUCCESS); } + sTheRecord->mIDToRollback = -1; #endif } -/** The finalize method shuts down the snapshotting system. */ -//Subramanian -- remove this function from the external interface and -//have us call it internally -void finalize(){ -#if !USE_MPROTECT_SNAPSHOT - sTheRecord->mbFinalize = true; -#endif -} diff --git a/snapshot.h b/snapshot.h index cbbe0070..629f63a0 100644 --- a/snapshot.h +++ b/snapshot.h @@ -11,7 +11,7 @@ /* If USE_MPROTECT_SNAPSHOT=1, then snapshot by using mmap() and mprotect() If USE_MPROTECT_SNAPSHOT=0, then snapshot by using fork() */ -#define USE_MPROTECT_SNAPSHOT 1 +#define USE_MPROTECT_SNAPSHOT 0 /* Size of signal stack */ #define SIGSTACKSIZE 32768 diff --git a/snapshotimp.h b/snapshotimp.h index 7ab009ec..e9f6d8bd 100644 --- a/snapshotimp.h +++ b/snapshotimp.h @@ -63,7 +63,6 @@ struct Snapshot { snapshot_id mIDToRollback; ucontext_t mContextToRollback; snapshot_id currSnapShotID; - volatile bool mbFinalize; }; extern struct Snapshot * sTheRecord; #endif