more documentation
[c11tester.git] / main.cc
diff --git a/main.cc b/main.cc
index 5d036f2d5c940350633f98defb5165d4cba63704..be4c58db7aac6411dd77ed26d7835d42f9f92479 100644 (file)
--- a/main.cc
+++ b/main.cc
@@ -4,7 +4,6 @@
 
 /* global "model" object */
 #include "model.h"
-#include "snapshot.h"
 #include "snapshot-interface.h"
 
 /*
@@ -12,7 +11,7 @@
  */
 static int thread_system_next(void) {
        Thread *curr, *next;
-  
+
        curr = thread_current();
        if (curr) {
                if (curr->get_state() == THREAD_READY) {
@@ -43,27 +42,30 @@ void real_main() {
        thrd_t user_thread;
        ucontext_t main_context;
 
-       //Create the singleton snapshotStack object
-       snapshotObject = new snapshotStack();
-  
+       //Create the singleton SnapshotStack object
+       snapshotObject = new SnapshotStack();
+
        model = new ModelChecker();
-  
+
        if (getcontext(&main_context))
                return;
-  
+
        model->set_system_context(&main_context);
 
+       snapshotObject->snapshotStep(0);
+
        do {
                /* Start user program */
                model->add_thread(new Thread(&user_thread, (void (*)(void *)) &user_main, NULL));
-    
+
                /* Wait for all threads to complete */
                thread_wait_finish();
        } while (model->next_execution());
-  
+
        delete model;
-  
+
        DEBUG("Exiting\n");
+       finalize();
 }
 
 int main_numargs;
@@ -78,5 +80,5 @@ int main(int numargs, char ** args) {
        main_args=args;
 
        /* Let's jump in quickly and start running stuff */
-       initSnapShotLibrary(10000 /*int numbackingpages*/, 1024 /*unsigned int numsnapshots*/, 1024 /*unsigned int nummemoryregions*/ , 1000 /*int numheappages*/, &real_main /*MyFuncPtr entryPoint*/);
+       initSnapShotLibrary(10000, 1024, 1024, 1000, &real_main);
 }