X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/fe50f12c40cd5b19c48e931a496bcb33ea8fb608..b72e8264dccedfa1c53042e99f94d3a8e5387316:/src/mc/mc_checkpoint.c diff --git a/src/mc/mc_checkpoint.c b/src/mc/mc_checkpoint.c index 8a5861c566..5384c3893f 100644 --- a/src/mc/mc_checkpoint.c +++ b/src/mc/mc_checkpoint.c @@ -34,6 +34,8 @@ static xbt_strbuff_t get_local_variables_values(void *stack_context, void *heap) static void print_local_variables_values(xbt_dynar_t all_variables); static void *get_stack_pointer(void *stack_context, void *heap); +static void snapshot_stack_free(mc_snapshot_stack_t s); + static mc_mem_region_t MC_region_new(int type, void *start_addr, size_t size) { mc_mem_region_t new_reg = xbt_new0(s_mc_mem_region_t, 1); @@ -191,6 +193,7 @@ void MC_free_snapshot(mc_snapshot_t snapshot) for(i=0; i < snapshot->num_reg; i++) MC_region_destroy(snapshot->regions[i]); + xbt_dynar_free(&(snapshot->stacks)); xbt_free(snapshot); } @@ -545,3 +548,15 @@ static void print_local_variables_values(xbt_dynar_t all_variables){ } } + +static void snapshot_stack_free(mc_snapshot_stack_t s){ + if(s){ + xbt_free(s->local_variables->data); + xbt_free(s->local_variables); + xbt_free(s); + } +} + +void snapshot_stack_free_voidp(void *s){ + snapshot_stack_free((mc_snapshot_stack_t) * (void **) s); +}