/* Primary struct for snapshotting system */
struct mprot_snapshotter {
mprot_snapshotter(unsigned int numbackingpages, unsigned int numsnapshots, unsigned int nummemoryregions);
/* Primary struct for snapshotting system */
struct mprot_snapshotter {
mprot_snapshotter(unsigned int numbackingpages, unsigned int numsnapshots, unsigned int nummemoryregions);
struct MemoryRegion *regionsToSnapShot; //This pointer references an array of memory regions to snapshot
snapshot_page_t *backingStore; //This pointer references an array of snapshotpage's that form the backing store
struct MemoryRegion *regionsToSnapShot; //This pointer references an array of memory regions to snapshot
snapshot_page_t *backingStore; //This pointer references an array of snapshotpage's that form the backing store
void *basemySpace = model_malloc((numheappages + 1) * PAGESIZE);
void *pagealignedbase = PageAlignAddressUpward(basemySpace);
user_snapshot_space = create_mspace_with_base(pagealignedbase, numheappages * PAGESIZE, 1);
void *basemySpace = model_malloc((numheappages + 1) * PAGESIZE);
void *pagealignedbase = PageAlignAddressUpward(basemySpace);
user_snapshot_space = create_mspace_with_base(pagealignedbase, numheappages * PAGESIZE, 1);
void *base_model_snapshot_space = model_malloc((numheappages + 1) * PAGESIZE);
pagealignedbase = PageAlignAddressUpward(base_model_snapshot_space);
model_snapshot_space = create_mspace_with_base(pagealignedbase, numheappages * PAGESIZE, 1);
void *base_model_snapshot_space = model_malloc((numheappages + 1) * PAGESIZE);
pagealignedbase = PageAlignAddressUpward(base_model_snapshot_space);
model_snapshot_space = create_mspace_with_base(pagealignedbase, numheappages * PAGESIZE, 1);
-/** The initSnapshotLibrary function initializes the snapshot library.
- * @param entryPoint the function that should run the program.
+/**
+ * @brief Initializes the snapshot system
+ * @param entryPoint the function that should run the program.
unsigned int numsnapshots, unsigned int nummemoryregions,
unsigned int numheappages, VoidFuncPtr entryPoint)
{
unsigned int numsnapshots, unsigned int nummemoryregions,
unsigned int numheappages, VoidFuncPtr entryPoint)
{
-/** The addMemoryRegionToSnapShot function assumes that addr is page aligned. */
-void addMemoryRegionToSnapShot(void *addr, unsigned int numPages)
+/** Assumes that addr is page aligned. */
+void snapshot_add_memory_region(void *addr, unsigned int numPages)
{
#if USE_MPROTECT_SNAPSHOT
mprot_add_to_snapshot(addr, numPages);
{
#if USE_MPROTECT_SNAPSHOT
mprot_add_to_snapshot(addr, numPages);