From: Brian Norris Date: Mon, 8 Oct 2012 19:46:53 +0000 (-0700) Subject: snapshot: don't need any snapshotting space for fork-based X-Git-Url: http://plrg.eecs.uci.edu/git/?p=c11tester.git;a=commitdiff_plain;h=127a76db778e47f861ad967985f2dd18a93582f6 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... --- diff --git a/mymemory.cc b/mymemory.cc index 7aec2dc8..c076f544 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 747f7c25..a5f292f0 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();