snapshot: don't need any snapshotting space for fork-based
authorBrian Norris <banorris@uci.edu>
Mon, 8 Oct 2012 19:46:53 +0000 (12:46 -0700)
committerBrian Norris <banorris@uci.edu>
Mon, 8 Oct 2012 19:47:25 +0000 (12:47 -0700)
I have no idea why this was here in the first place. Somebody didn't
know what they were doing...

mymemory.cc
snapshot.cc

index 7aec2dc81d549bcf0fe82951ee902723077b5cf0..c076f5449c5a2f8e70c5ae7ef48ade0733937b5c 100644 (file)
@@ -127,9 +127,6 @@ void model_free(void *ptr)
 #endif
 }
 
-/** @brief Global mspace reference for the snapshotting heap */
-mspace snapshot_space = NULL;
-
 /** Bootstrap allocation.  Problem is that the dynamic linker calls
  *  require calloc to work and calloc requires the dynamic linker to
  *     work.  */
@@ -153,6 +150,11 @@ void * HandleEarlyAllocationRequest(size_t sz)
        return pointer;
 }
 
+#if USE_MPROTECT_SNAPSHOT
+
+/** @brief Global mspace reference for the snapshotting heap */
+mspace snapshot_space = NULL;
+
 /** Check whether this is bootstrapped memory that we should not free */
 static bool DontFree(void *ptr)
 {
@@ -222,3 +224,4 @@ void operator delete[](void *p, size_t size)
 {
        free(p);
 }
+#endif /* USE_MPROTECT_SNAPSHOT */
index 747f7c2502529306dfc07fd32a09b72c4f5ad2e9..a5f292f063e31a7eb45da0e0a8c916dbb6e9674c 100644 (file)
@@ -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) {
-       void *basemySpace = system_malloc((numheappages+1)*PAGESIZE);
-       void * pagealignedbase=PageAlignAddressUpward(basemySpace);
-       snapshot_space = create_mspace_with_base(pagealignedbase, numheappages * PAGESIZE, 1);
        if (!snapshotrecord)
                createSharedMemory();