snapshot: don't need any snapshotting space for fork-based
[model-checker.git] / snapshot.cc
index f129f4cc31da565aeed8bfd0b2a5d1f4b063e8a5..a5f292f063e31a7eb45da0e0a8c916dbb6e9674c 100644 (file)
@@ -171,9 +171,9 @@ void initSnapshotLibrary(unsigned int numbackingpages,
        HandlePF(SIGSEGV, &si, NULL);
        snapshotrecord->lastBackingPage--; //remove the fake page we copied
 
-       basemySpace=model_malloc((numheappages+1)*PAGESIZE);
+       void *basemySpace = model_malloc((numheappages+1)*PAGESIZE);
        void * pagealignedbase=PageAlignAddressUpward(basemySpace);
-       mySpace = create_mspace_with_base(pagealignedbase,  numheappages*PAGESIZE, 1 );
+       snapshot_space = create_mspace_with_base(pagealignedbase, numheappages*PAGESIZE, 1 );
        addMemoryRegionToSnapShot(pagealignedbase, numheappages);
        entryPoint();
 }
@@ -181,9 +181,6 @@ 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);
-       void * pagealignedbase=PageAlignAddressUpward(basemySpace);
-       mySpace = create_mspace_with_base(pagealignedbase,  numheappages*PAGESIZE, 1 );
        if (!snapshotrecord)
                createSharedMemory();