+
+/**
+ * @brief Initializes the snapshot system
+ * @param entryPoint the function that should run the program.
+ */
+void snapshot_system_init(unsigned int numbackingpages,
+ unsigned int numsnapshots, unsigned int nummemoryregions,
+ unsigned int numheappages, VoidFuncPtr entryPoint)
+{
+#if USE_MPROTECT_SNAPSHOT
+ mprot_snapshot_init(numbackingpages, numsnapshots, nummemoryregions, numheappages, entryPoint);
+#else
+ fork_snapshot_init(numbackingpages, numsnapshots, nummemoryregions, numheappages, entryPoint);
+#endif
+}
+
+/** 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);
+#else
+ /* not needed for fork-based snapshotting */
+#endif
+}
+
+/** Takes a snapshot of memory.
+ * @return The snapshot identifier.
+ */
+snapshot_id take_snapshot()
+{
+#if USE_MPROTECT_SNAPSHOT
+ return mprot_take_snapshot();
+#else
+ return fork_take_snapshot();
+#endif
+}
+
+/** Rolls the memory state back to the given snapshot identifier.
+ * @param theID is the snapshot identifier to rollback to.
+ */
+void snapshot_roll_back(snapshot_id theID)
+{
+#if USE_MPROTECT_SNAPSHOT
+ mprot_roll_back(theID);
+#else
+ fork_roll_back(theID);
+#endif
+}