X-Git-Url: http://plrg.eecs.uci.edu/git/?p=c11tester.git;a=blobdiff_plain;f=snapshot.cc;h=d73613832e867eb069b5f5288b72f95bc04c96ff;hp=bada736d35ab0979b217d923785efcec4acde7f1;hb=1b2081fd7a99dd894f75b8606073d3eae57a0013;hpb=d15971f784c68e45199ee9052773d6546af131aa diff --git a/snapshot.cc b/snapshot.cc index bada736d..d7361383 100644 --- a/snapshot.cc +++ b/snapshot.cc @@ -12,6 +12,7 @@ #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. @@ -383,7 +384,11 @@ static void fork_snapshot_init(unsigned int numbackingpages, /* 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;