X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=snapshot.cc;h=dadb75956c1f4254c3ecc84d519cd7431a8910af;hb=f94de5b6daa067501562ed3047bfb6b4939f9435;hp=2c7d84193e1feb21443696335603b951491be9af;hpb=7f9bbee401eb5c04bd0a050c0daf19813e81a783;p=model-checker.git diff --git a/snapshot.cc b/snapshot.cc index 2c7d841..dadb759 100644 --- a/snapshot.cc +++ b/snapshot.cc @@ -283,8 +283,17 @@ snapshot_id takeSnapshot( ){ * @param theID is the snapshot identifier to rollback to. */ void rollBack( snapshot_id theID ){ +#if USE_MPOTECT_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)); + } + return; + } +#endif + #if USE_MPROTECT_SNAPSHOT - HashTable< void *, bool, uintptr_t, 4, model_malloc, model_calloc, MYFREE> duplicateMap; + HashTable< void *, bool, uintptr_t, 4, model_malloc, model_calloc, model_free> duplicateMap; for(unsigned int region=0; regionlastRegion;region++) { if( mprotect(snapshotrecord->regionsToSnapShot[region].basePtr, snapshotrecord->regionsToSnapShot[region].sizeInPages*sizeof(struct SnapShotPage), PROT_READ | PROT_WRITE ) == -1 ){ perror("mprotect");