I have no idea why this was here in the first place. Somebody didn't
know what they were doing...
#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. */
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)
{
{
free(p);
}
+#endif /* USE_MPROTECT_SNAPSHOT */
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();