X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=snapshot.cc;h=f129f4cc31da565aeed8bfd0b2a5d1f4b063e8a5;hb=8669bd6f88178382893b48223498611f2200714a;hp=dadb75956c1f4254c3ecc84d519cd7431a8910af;hpb=c80c149893770f4b86b3578a827c6a028985de7f;p=model-checker.git diff --git a/snapshot.cc b/snapshot.cc index dadb759..f129f4c 100644 --- a/snapshot.cc +++ b/snapshot.cc @@ -129,17 +129,17 @@ void createSharedMemory(){ #endif -/** The initSnapShotLibrary function initializes the Snapshot library. +/** The initSnapshotLibrary function initializes the snapshot library. * @param entryPoint the function that should run the program. */ #if USE_MPROTECT_SNAPSHOT -void initSnapShotLibrary(unsigned int numbackingpages, +void initSnapshotLibrary(unsigned int numbackingpages, unsigned int numsnapshots, unsigned int nummemoryregions, unsigned int numheappages, VoidFuncPtr entryPoint) { /* Setup a stack for our signal handler.... */ stack_t ss; - ss.ss_sp = model_malloc(SIGSTACKSIZE); + ss.ss_sp = PageAlignAddressUpward(model_malloc(SIGSTACKSIZE+PAGESIZE-1)); ss.ss_size = SIGSTACKSIZE; ss.ss_flags = 0; sigaltstack(&ss, NULL); @@ -178,7 +178,7 @@ void initSnapShotLibrary(unsigned int numbackingpages, entryPoint(); } #else -void initSnapShotLibrary(unsigned int numbackingpages, +void initSnapshotLibrary(unsigned int numbackingpages, unsigned int numsnapshots, unsigned int nummemoryregions, unsigned int numheappages, VoidFuncPtr entryPoint) { basemySpace=system_malloc((numheappages+1)*PAGESIZE); @@ -283,7 +283,7 @@ snapshot_id takeSnapshot( ){ * @param theID is the snapshot identifier to rollback to. */ void rollBack( snapshot_id theID ){ -#if USE_MPOTECT_SNAPSHOT==2 +#if USE_MPROTECT_SNAPSHOT==2 if (snapshotrecord->lastSnapShot==(theID+1)) { for(unsigned int page=snapshotrecord->snapShots[theID].firstBackingPage; pagelastBackingPage; page++) { memcpy(snapshotrecord->backingRecords[page].basePtrOfPage, &snapshotrecord->backingStore[page], sizeof(struct SnapShotPage));