From 17446381d6542f54be93ab3d2cc1d274f2a314a7 Mon Sep 17 00:00:00 2001 From: Brian Demsky Date: Fri, 18 May 2012 18:21:39 -0700 Subject: [PATCH] my changes --- main.cc | 4 ++++ snapshot-interface.cc | 2 ++ snapshot-interface.h | 5 +++++ 3 files changed, 11 insertions(+) diff --git a/main.cc b/main.cc index 4de5967..800b873 100644 --- 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(); diff --git a/snapshot-interface.cc b/snapshot-interface.cc index 952d790..770f316 100644 --- a/snapshot-interface.cc +++ b/snapshot-interface.cc @@ -13,6 +13,8 @@ #include #include +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; diff --git a/snapshot-interface.h b/snapshot-interface.h index 5f5f4ea..cbebcd5 100644 --- a/snapshot-interface.h +++ b/snapshot-interface.h @@ -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 -- 2.34.1