static ucontext_t savedSnapshotContext;
static ucontext_t savedUserSnapshotContext;
static snapshot_id snapshotid = 0;
-#endif
+
+#else /* USE_MPROTECT_SNAPSHOT */
/** PageAlignedAdressUpdate return a page aligned address for the
* address being added as a side effect the numBytes are also changed.
return (void *)((((uintptr_t)addr)+PAGESIZE-1)&~(PAGESIZE-1));
}
-#if USE_MPROTECT_SNAPSHOT
-
/** ReturnPageAlignedAddress returns a page aligned address for the
* address being added as a side effect the numBytes are also changed.
*/
// Handle error by quitting?
}
}
-#endif //nothing to handle for non snapshotting case.
+#endif /* USE_MPROTECT_SNAPSHOT */
#if !USE_MPROTECT_SNAPSHOT
void createSharedMemory(){
void *basemySpace = model_malloc((numheappages+1)*PAGESIZE);
void * pagealignedbase=PageAlignAddressUpward(basemySpace);
- snapshot_space = create_mspace_with_base(pagealignedbase, numheappages*PAGESIZE, 1 );
+ user_snapshot_space = create_mspace_with_base(pagealignedbase, numheappages * PAGESIZE, 1);
addMemoryRegionToSnapShot(pagealignedbase, numheappages);
entryPoint();
}