snapshot: remove global 'basemySpace'
authorBrian Norris <banorris@uci.edu>
Mon, 8 Oct 2012 19:13:07 +0000 (12:13 -0700)
committerBrian Norris <banorris@uci.edu>
Mon, 8 Oct 2012 19:14:51 +0000 (12:14 -0700)
Why was this here?

mymemory.cc
mymemory.h
snapshot.cc

index 95459be561af6b7bab74d50610d470f1005c4464..54885ca12deb46a50eba387a66edc58fba52b5ea 100644 (file)
@@ -142,10 +142,6 @@ void model_free(void *ptr) {
 /** @brief Global mspace reference for the snapshotting heap */
 mspace mySpace = NULL;
 
-/** @brief Global reference to the unaligned memory address that was malloc'd
- * for the snapshotting heap */
-void *basemySpace = NULL;
-
 /** Bootstrap allocation.  Problem is that the dynamic linker calls
  *  require calloc to work and calloc requires the dynamic linker to
  *     work.  */
index 87ee0e92b5bc863b344302a8ea6888571b21be76..a2b73cb228aacd80e470e00610a30773948171c3 100644 (file)
@@ -153,7 +153,6 @@ extern void* mspace_calloc(mspace msp, size_t n_elements, size_t elem_size);
 extern mspace create_mspace_with_base(void* base, size_t capacity, int locked);
 extern mspace create_mspace(size_t capacity, int locked);
 extern mspace mySpace;
-extern void * basemySpace;
 #ifdef __cplusplus
 };  /* end of extern "C" */
 #endif
index f129f4cc31da565aeed8bfd0b2a5d1f4b063e8a5..734d161c4610bcf5829ba2dc20425d0640944cdb 100644 (file)
@@ -171,7 +171,7 @@ 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 );
        addMemoryRegionToSnapShot(pagealignedbase, numheappages);
@@ -181,7 +181,7 @@ 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 *basemySpace = system_malloc((numheappages+1)*PAGESIZE);
        void * pagealignedbase=PageAlignAddressUpward(basemySpace);
        mySpace = create_mspace_with_base(pagealignedbase,  numheappages*PAGESIZE, 1 );
        if (!snapshotrecord)