From: Brian Norris <banorris@uci.edu>
Date: Thu, 3 Jan 2013 03:10:28 +0000 (-0800)
Subject: snapshot: add (unused) mprot_snapshotter destructor
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=bd67491a35b9a462e1775d154d3eecfe33711984;p=c11tester.git

snapshot: add (unused) mprot_snapshotter destructor
---

diff --git a/snapshot.cc b/snapshot.cc
index 73a9d3a6..6d6b4507 100644
--- a/snapshot.cc
+++ b/snapshot.cc
@@ -57,6 +57,7 @@ static void * ReturnPageAlignedAddress(void *addr)
 /* Primary struct for snapshotting system */
 struct mprot_snapshotter {
 	mprot_snapshotter(unsigned int numbackingpages, unsigned int numsnapshots, unsigned int nummemoryregions);
+	~mprot_snapshotter();
 
 	struct MemoryRegion *regionsToSnapShot; //This pointer references an array of memory regions to snapshot
 	snapshot_page_t *backingStore; //This pointer references an array of snapshotpage's that form the backing store
@@ -93,6 +94,14 @@ mprot_snapshotter::mprot_snapshotter(unsigned int backing_pages, unsigned int sn
 	snapShots = (struct SnapShotRecord *)model_malloc(sizeof(struct SnapShotRecord) * snapshots);
 }
 
+mprot_snapshotter::~mprot_snapshotter()
+{
+	model_free(regionsToSnapShot);
+	model_free(backingStoreBasePtr);
+	model_free(backingRecords);
+	model_free(snapShots);
+}
+
 /** mprot_handle_pf is the page fault handler for mprotect based snapshotting
  * algorithm.
  */