From: Gabriel Corona Date: Mon, 16 Jun 2014 13:29:26 +0000 (+0200) Subject: [mc] Remove useless parts in mmalloc_compare_heap, MC_take_snapshot_stacks, snapshot_... X-Git-Tag: v3_12~956^2~1^2~43 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/873bf1e1e1e844397bb532a80deee528563bc006 [mc] Remove useless parts in mmalloc_compare_heap, MC_take_snapshot_stacks, snapshot_compare --- diff --git a/include/xbt/mmalloc.h b/include/xbt/mmalloc.h index fcf2fecb3b..e4bf2a5595 100644 --- a/include/xbt/mmalloc.h +++ b/include/xbt/mmalloc.h @@ -66,7 +66,7 @@ xbt_mheap_t mmalloc_get_current_heap(void); struct s_mc_snapshot; struct s_dw_type; -int mmalloc_compare_heap(struct s_mc_snapshot* snapshot1, struct s_mc_snapshot* snapshot2, xbt_mheap_t heap1, xbt_mheap_t heap2); +int mmalloc_compare_heap(struct s_mc_snapshot* snapshot1, struct s_mc_snapshot* snapshot2); int mmalloc_linear_compare_heap(xbt_mheap_t heap1, xbt_mheap_t heap2); int init_heap_information(xbt_mheap_t heap1, xbt_mheap_t heap2, xbt_dynar_t to_ignore1, xbt_dynar_t to_ignore2); int compare_heap_area(void *area1, void* area2, struct s_mc_snapshot* snapshot1, struct s_mc_snapshot* snapshot2, xbt_dynar_t previous, struct s_dw_type *type, int pointer_level); diff --git a/src/mc/mc_checkpoint.c b/src/mc/mc_checkpoint.c index 17cc3d5d92..883f9002d5 100644 --- a/src/mc/mc_checkpoint.c +++ b/src/mc/mc_checkpoint.c @@ -462,7 +462,7 @@ static xbt_dynar_t MC_unwind_stack_frames(void *stack_context) return result; }; -static xbt_dynar_t MC_take_snapshot_stacks(mc_snapshot_t * snapshot, void *heap) +static xbt_dynar_t MC_take_snapshot_stacks(mc_snapshot_t * snapshot) { xbt_dynar_t res = @@ -593,7 +593,7 @@ mc_snapshot_t MC_take_snapshot(int num_state) if (_sg_mc_visited > 0 || strcmp(_sg_mc_property_file, "")) { snapshot->stacks = - MC_take_snapshot_stacks(&snapshot, snapshot->regions[0]->data); + MC_take_snapshot_stacks(&snapshot); if (_sg_mc_hash && snapshot->stacks != NULL) { snapshot->hash = mc_hash_processes_state(num_state, snapshot->stacks); } else { diff --git a/src/mc/mc_compare.c b/src/mc/mc_compare.c index 77533e7e64..60bc78ff28 100644 --- a/src/mc/mc_compare.c +++ b/src/mc/mc_compare.c @@ -607,8 +607,7 @@ int snapshot_compare(void *state1, void *state2) #endif /* Compare heap */ - if (mmalloc_compare_heap(s1, s2, (xbt_mheap_t) s1->regions[0]->data, - (xbt_mheap_t) s2->regions[0]->data) > 0) { + if (mmalloc_compare_heap(s1, s2) > 0) { #ifdef MC_DEBUG xbt_os_walltimer_stop(timer); diff --git a/src/mc/mc_diff.c b/src/mc/mc_diff.c index 5f66c883a6..2adc6415a0 100644 --- a/src/mc/mc_diff.c +++ b/src/mc/mc_diff.c @@ -434,17 +434,11 @@ void reset_heap_information() } -int mmalloc_compare_heap(mc_snapshot_t snapshot1, mc_snapshot_t snapshot2, - xbt_mheap_t heap1, xbt_mheap_t heap2) +int mmalloc_compare_heap(mc_snapshot_t snapshot1, mc_snapshot_t snapshot2) { struct s_mc_diff *state = mc_diff_info; - if (heap1 == NULL && heap2 == NULL) { - XBT_DEBUG("Malloc descriptors null"); - return 0; - } - /* Start comparison */ size_t i1, i2, j1, j2, k; void *addr_block1, *addr_block2, *addr_frag1, *addr_frag2;