fixing the segfault
[model-checker.git] / snapshot.cc
index 8761862ca5f67e01e431fd9de006dab095b7dd6b..9ff0ea20b169f16f09977b65a10055d2887fe73e 100644 (file)
@@ -123,7 +123,7 @@ void createSharedLibrary(){
 #ifdef __cplusplus
 }
 #endif
-void initSnapShotLibrary(unsigned int numbackingpages, unsigned int numsnapshots, unsigned int nummemoryregions , MyFuncPtr entryPoint){
+void initSnapShotLibrary(unsigned int numbackingpages, unsigned int numsnapshots, unsigned int nummemoryregions, unsigned int numheappages, MyFuncPtr entryPoint){
 #if USE_CHECKPOINTING
   struct sigaction sa;
   sa.sa_flags = SA_SIGINFO | SA_NODEFER | SA_RESTART;
@@ -133,7 +133,9 @@ void initSnapShotLibrary(unsigned int numbackingpages, unsigned int numsnapshots
     printf("SIGACTION CANNOT BE INSTALLED\n");
     exit(-1);
   }
+  mySpace = create_mspace( numheappages*PAGESIZE, 1 );
   initSnapShotRecord(numbackingpages, numsnapshots, nummemoryregions);
+  addMemoryRegionToSnapShot(mySpace, numheappages);
   entryPoint();
 #else
   //add a signal to indicate that the process is going to terminate.