From: Brian Demsky Date: Sat, 19 May 2012 01:21:39 +0000 (-0700) Subject: my changes X-Git-Url: http://plrg.eecs.uci.edu/git/?p=c11tester.git;a=commitdiff_plain;h=17446381d6542f54be93ab3d2cc1d274f2a314a7 my changes --- diff --git a/main.cc b/main.cc index 4de59674..800b873e 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 952d7906..770f316c 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 5f5f4ea0..cbebcd58 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