From 127a76db778e47f861ad967985f2dd18a93582f6 Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Mon, 8 Oct 2012 12:46:53 -0700 Subject: [PATCH] snapshot: don't need any snapshotting space for fork-based I have no idea why this was here in the first place. Somebody didn't know what they were doing... --- mymemory.cc | 9 ++++++--- snapshot.cc | 3 --- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mymemory.cc b/mymemory.cc index 7aec2dc..c076f54 100644 --- a/mymemory.cc +++ b/mymemory.cc @@ -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 */ diff --git a/snapshot.cc b/snapshot.cc index 747f7c2..a5f292f 100644 --- a/snapshot.cc +++ b/snapshot.cc @@ -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(); -- 2.34.1