edits
[c11tester.git] / snapshot.cc
index ca54c785385bb85b0fa68ada3267c933dd9ca8f0..b4944f45527e8e93303235d6ddaa5d7f0b9f208e 100644 (file)
@@ -12,6 +12,7 @@
 #include "mymemory.h"
 #include "common.h"
 #include "context.h"
 #include "mymemory.h"
 #include "common.h"
 #include "context.h"
+#include "model.h"
 
 /** PageAlignedAdressUpdate return a page aligned address for the
  * address being added as a side effect the numBytes are also changed.
 
 /** PageAlignedAdressUpdate return a page aligned address for the
  * address being added as a side effect the numBytes are also changed.
@@ -383,7 +384,11 @@ static void fork_snapshot_init(unsigned int numbackingpages,
 
        /* switch back here when takesnapshot is called */
        snapshotid = fork_snap->currSnapShotID;
 
        /* switch back here when takesnapshot is called */
        snapshotid = fork_snap->currSnapShotID;
-
+       if (model->params.nofork) {
+         setcontext(&fork_snap->shared_ctxt);
+         exit(EXIT_SUCCESS);
+       }
+       
        while (true) {
                pid_t forkedID;
                fork_snap->currSnapShotID = snapshotid + 1;
        while (true) {
                pid_t forkedID;
                fork_snap->currSnapShotID = snapshotid + 1;