my changes
authorBrian Demsky <bdemsky@uci.edu>
Sat, 19 May 2012 01:21:39 +0000 (18:21 -0700)
committerBrian Demsky <bdemsky@uci.edu>
Sat, 19 May 2012 01:21:39 +0000 (18:21 -0700)
main.cc
snapshot-interface.cc
snapshot-interface.h

diff --git a/main.cc b/main.cc
index 4de59674c8a2410fa6717c656e8746636ec3b6e1..800b873e8d8a2f8295d96879eed0b21bd8087ab8 100644 (file)
--- a/main.cc
+++ b/main.cc
@@ -5,6 +5,7 @@
 /* global "model" object */
 #include "model.h"
 #include "snapshot.h"
+#include "snapshot-interface.h"
 
 /*
  * Return 1 if found next thread, 0 otherwise
@@ -45,6 +46,9 @@ static void thread_wait_finish(void) {
 void real_main() {
   thrd_t user_thread;
   ucontext_t main_context;
+
+  //Create the singleton snapshotStack object
+  snapshotObject = new snapshotStack();
   
   model = new ModelChecker();
   
index 952d7906c984a75f32be66b45c11eed8ca105611..770f316c788feb503fdad69b392859bffe80e72f 100644 (file)
@@ -13,6 +13,8 @@
 #include <cstring>
 #include <cassert>
 
+snapshotStack * snapshotObject;
+
 /*This looks like it might leak memory...  Subramanian should fix this. */
 
 typedef std::basic_stringstream< char, std::char_traits< char >, MyAlloc< char > > MyStringStream;
index 5f5f4ea01246b8fa506e06dcfb5cba5f3a38ef81..cbebcd58f84a5902fcb784de16f0d439b137513b 100644 (file)
@@ -32,4 +32,9 @@ class snapshotStack {
  private: 
   struct stackEntry * stack;
 };
+
+/* Not sure what it even means to have more than one snapshot object,
+   so let's just make a global reference to it.*/
+
+extern snapshotStack * snapshotObject;
 #endif