From 5f85e1b11c1578a4b6fb64c18285d1d627d732df Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Mon, 8 Oct 2012 12:13:07 -0700 Subject: [PATCH] snapshot: remove global 'basemySpace' Why was this here? --- mymemory.cc | 4 ---- mymemory.h | 1 - snapshot.cc | 4 ++-- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/mymemory.cc b/mymemory.cc index 95459be5..54885ca1 100644 --- a/mymemory.cc +++ b/mymemory.cc @@ -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. */ diff --git a/mymemory.h b/mymemory.h index 87ee0e92..a2b73cb2 100644 --- a/mymemory.h +++ b/mymemory.h @@ -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 diff --git a/snapshot.cc b/snapshot.cc index f129f4cc..734d161c 100644 --- a/snapshot.cc +++ b/snapshot.cc @@ -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) -- 2.34.1