if (w == 'w' && (strstr(regionname, MYBINARYNAME) || strstr(regionname, MYLIBRARYNAME))) {
size_t len = ((uintptr_t)end - (uintptr_t)begin) / PAGESIZE;
if (len != 0)
- addMemoryRegionToSnapShot(begin, len);
+ snapshot_add_memory_region(begin, len);
}
}
pclose(map);
if (w == 'w' && (strstr(regionname, binary_name) || strstr(regionname, MYLIBRARYNAME))) {
size_t len = ((uintptr_t)end - (uintptr_t)begin) / PAGESIZE;
if (len != 0)
- addMemoryRegionToSnapShot(begin, len);
+ snapshot_add_memory_region(begin, len);
DEBUG("%55s: %18p - %18p\t%c%c%c%c\n", regionname, begin, end, r, w, x, p);
}
}
while (true) {
if (stack->index <= seqindex) {
//have right entry
- rollBack(stack->snapshotid);
+ snapshot_roll_back(stack->snapshotid);
return stack->index;
}
struct stackEntry *tmp = stack;
struct stackEntry *tmp = (struct stackEntry *)model_malloc(sizeof(struct stackEntry));
tmp->next = stack;
tmp->index = seqindex;
- tmp->snapshotid = takeSnapshot();
+ tmp->snapshotid = take_snapshot();
stack = tmp;
}
void *basemySpace = model_malloc((numheappages + 1) * PAGESIZE);
void *pagealignedbase = PageAlignAddressUpward(basemySpace);
user_snapshot_space = create_mspace_with_base(pagealignedbase, numheappages * PAGESIZE, 1);
- addMemoryRegionToSnapShot(pagealignedbase, numheappages);
+ snapshot_add_memory_region(pagealignedbase, numheappages);
void *base_model_snapshot_space = model_malloc((numheappages + 1) * PAGESIZE);
pagealignedbase = PageAlignAddressUpward(base_model_snapshot_space);
model_snapshot_space = create_mspace_with_base(pagealignedbase, numheappages * PAGESIZE, 1);
- addMemoryRegionToSnapShot(pagealignedbase, numheappages);
+ snapshot_add_memory_region(pagealignedbase, numheappages);
entryPoint();
}
#endif
}
-/** The addMemoryRegionToSnapShot function assumes that addr is page aligned. */
-void addMemoryRegionToSnapShot(void *addr, unsigned int numPages)
+/** Assumes that addr is page aligned. */
+void snapshot_add_memory_region(void *addr, unsigned int numPages)
{
#if USE_MPROTECT_SNAPSHOT
mprot_add_to_snapshot(addr, numPages);
#endif
}
-/** The takeSnapshot function takes a snapshot.
+/** Takes a snapshot of memory.
* @return The snapshot identifier.
*/
-snapshot_id takeSnapshot()
+snapshot_id take_snapshot()
{
#if USE_MPROTECT_SNAPSHOT
return mprot_take_snapshot();
#endif
}
-/** The rollBack function rollback to the given snapshot identifier.
+/** Rolls the memory state back to the given snapshot identifier.
* @param theID is the snapshot identifier to rollback to.
*/
-void rollBack(snapshot_id theID)
+void snapshot_roll_back(snapshot_id theID)
{
#if USE_MPROTECT_SNAPSHOT
mprot_roll_back(theID);
#include "config.h"
#include "mymemory.h"
-void addMemoryRegionToSnapShot(void *ptr, unsigned int numPages);
-snapshot_id takeSnapshot();
-void rollBack(snapshot_id theSnapShot);
+void snapshot_add_memory_region(void *ptr, unsigned int numPages);
+snapshot_id take_snapshot();
+void snapshot_roll_back(snapshot_id theSnapShot);
#if !USE_MPROTECT_SNAPSHOT
mspace create_shared_mspace();