Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
model-checker : free memory
[simgrid.git] / src / mc / mc_checkpoint.c
index cc87fe8..8f7a23d 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008-2012 Da SimGrid Team. All rights reserved.            */
+/* Copyright (c) 2008-2013 Da SimGrid Team. All rights reserved.            */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -231,6 +231,7 @@ void MC_free_snapshot(mc_snapshot_t snapshot)
   for(i=0; i < NB_REGIONS; i++)
     MC_region_destroy(snapshot->regions[i]);
 
+  xbt_free(snapshot->stack_sizes);
   xbt_dynar_free(&(snapshot->stacks));
   xbt_dynar_free(&(snapshot->to_ignore));
   xbt_free(snapshot);
@@ -463,7 +464,7 @@ static xbt_strbuff_t get_local_variables_values(void *stack_context, void *heap)
     to_append = bprintf("frame_name=%s\n", frame_name);
     xbt_strbuff_append(variables, to_append);
     xbt_free(to_append);
-    to_append = bprintf("ip=%lx\n", ip);
+    to_append = bprintf("ip=%lx\n", (unsigned long)ip);
     xbt_strbuff_append(variables, to_append);
     xbt_free(to_append);
     
@@ -500,6 +501,7 @@ static xbt_strbuff_t get_local_variables_values(void *stack_context, void *heap)
 
             if(!xbt_dynar_is_empty(compose)){
               frame_pointer_address = xbt_dynar_get_as(compose, xbt_dynar_length(compose) - 1, variable_value_t)->value.address ; 
+              xbt_dynar_reset(compose);
             }
             break;
           default :
@@ -566,6 +568,7 @@ static xbt_strbuff_t get_local_variables_values(void *stack_context, void *heap)
                 xbt_free(to_append);
               }
             }
+            xbt_dynar_reset(compose);
           }else{
             to_append = bprintf("%s=undefined\n", current_variable->name);
             xbt_strbuff_append(variables, to_append);