Merge branch 'sandbox' (remove finalize())
authorBrian Norris <banorris@uci.edu>
Thu, 21 Jun 2012 09:11:15 +0000 (02:11 -0700)
committerBrian Norris <banorris@uci.edu>
Thu, 21 Jun 2012 09:11:27 +0000 (02:11 -0700)
Merge in the fix from Subramanian and me that eliminates the need for a
finalize() call. It was a kind of bug, in a way, that hopefully is fixed now...

main.cc
snapshot-interface.h
snapshot.cc
snapshotimp.h

diff --git a/main.cc b/main.cc
index 66ad9f1d0a6b9f34b9b416d37d7890957984565d..b38f7ef4816d003f45d876133dacf0dc0d816bab 100644 (file)
--- a/main.cc
+++ b/main.cc
@@ -78,7 +78,6 @@ void real_main() {
        delete model;
 
        DEBUG("Exiting\n");
-       finalize();
 }
 
 int main_numargs;
index 48fa2e3e0915247f6baece67fa46c62d5f21e7cb..5f54edb87f00f3299c20b1dc7beb9b5f4149107d 100644 (file)
@@ -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;
index a50835d1cca27ecd2c28aac29e798791dce3f69c..5fb1a85ebd4c4e633e1da3812b97776a893dccd8 100644 (file)
@@ -120,7 +120,6 @@ void createSharedLibrary(){
        sTheRecord->mStackSize = STACK_SIZE_DEFAULT;
        sTheRecord->mIDToRollback = -1;
        sTheRecord->currSnapShotID = 0;
-       sTheRecord->mbFinalize = false;
 #endif
 }
 
@@ -191,7 +190,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 ){
@@ -305,14 +304,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
-}
index 7ab009ec65c1439cc18f17bccadb31317ad2e0b0..e9f6d8bd50a4ab1493a8d0264c275fdfeade3b8b 100644 (file)
@@ -63,7 +63,6 @@ struct Snapshot {
        snapshot_id mIDToRollback;
        ucontext_t mContextToRollback;
        snapshot_id currSnapShotID;
-       volatile bool mbFinalize;
 };
 extern struct Snapshot * sTheRecord;
 #endif