use my{Malloc,Free} in model-checking code
authorBrian Norris <banorris@uci.edu>
Thu, 5 Apr 2012 03:14:27 +0000 (20:14 -0700)
committerBrian Norris <banorris@uci.edu>
Thu, 5 Apr 2012 17:05:44 +0000 (10:05 -0700)
Also, fixes 'leak' where we forgot to free the main_thread.

libthreads.cc

index 5a4c3a12f101f33252c042f7b5daf6c19d98cca4..c0439ffa8bc60b6754bbe744b335775a5dccebc0 100644 (file)
@@ -156,7 +156,7 @@ int main()
 
        model = new ModelChecker();
 
-       main_thread = (struct thread *)malloc(sizeof(*main_thread));
+       main_thread = (struct thread *)myMalloc(sizeof(*main_thread));
        create_initial_thread(main_thread);
        model->add_system_thread(main_thread);
 
@@ -167,6 +167,7 @@ int main()
        thread_wait_finish();
 
        delete model;
+       myFree(main_thread);
 
        DEBUG("Exiting\n");
        return 0;