Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Remove useless parts in mmalloc_compare_heap, MC_take_snapshot_stacks, snapshot_...
authorGabriel Corona <gabriel.corona@loria.fr>
Mon, 16 Jun 2014 13:29:26 +0000 (15:29 +0200)
committerGabriel Corona <gabriel.corona@loria.fr>
Mon, 16 Jun 2014 13:36:13 +0000 (15:36 +0200)
include/xbt/mmalloc.h
src/mc/mc_checkpoint.c
src/mc/mc_compare.c
src/mc/mc_diff.c

index fcf2fec..e4bf2a5 100644 (file)
@@ -66,7 +66,7 @@ xbt_mheap_t mmalloc_get_current_heap(void);
 struct s_mc_snapshot;
 struct s_dw_type;
 
 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);
 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);
index 17cc3d5..883f900 100644 (file)
@@ -462,7 +462,7 @@ static xbt_dynar_t MC_unwind_stack_frames(void *stack_context)
   return result;
 };
 
   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 =
 {
 
   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 =
 
   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 {
     if (_sg_mc_hash && snapshot->stacks != NULL) {
       snapshot->hash = mc_hash_processes_state(num_state, snapshot->stacks);
     } else {
index 77533e7..60bc78f 100644 (file)
@@ -607,8 +607,7 @@ int snapshot_compare(void *state1, void *state2)
 #endif
 
   /* Compare heap */
 #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);
 
 #ifdef MC_DEBUG
     xbt_os_walltimer_stop(timer);
index 5f66c88..2adc641 100644 (file)
@@ -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;
 
 {
 
   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;
   /* Start comparison */
   size_t i1, i2, j1, j2, k;
   void *addr_block1, *addr_block2, *addr_frag1, *addr_frag2;