+ #ifdef MC_VERBOSE
+ if(is_diff == 0)
+ xbt_os_timer_stop(timer);
+ xbt_os_timer_start(timer);
+ #endif
+
+ /* Compare libsimgrid global variables */
+ is_diff = compare_global_variables(s1->region_type[data_libsimgrid_index], s1->regions[data_libsimgrid_index]->data, s2->regions[data_libsimgrid_index]->data);
+ if(is_diff != 0){
+ #ifdef MC_DEBUG
+ xbt_os_timer_stop(timer);
+ mc_comp_times->libsimgrid_global_variables_comparison_time = xbt_os_timer_elapsed(timer);
+ XBT_DEBUG("Different global variables in libsimgrid");
+ errors++;
+ #else
+ #ifdef MC_VERBOSE
+ XBT_VERB("Different global variables in libsimgrid");
+ #endif
+
+ xbt_os_timer_free(timer);
+ xbt_os_timer_stop(global_timer);
+ mc_snapshot_comparison_time = xbt_os_timer_elapsed(global_timer);
+ xbt_os_timer_free(global_timer);
+
+ if(!raw_mem)
+ MC_UNSET_RAW_MEM;
+
+ return 1;
+ #endif
+ }
+
+ #ifdef MC_DEBUG
+ if(is_diff == 0)
+ xbt_os_timer_stop(timer);
+ xbt_os_timer_start(timer);
+ #endif
+
+ /* Compare heap */
+ xbt_dynar_t stacks1 = xbt_dynar_new(sizeof(stack_region_t), stack_region_free_voidp);
+ xbt_dynar_t stacks2 = xbt_dynar_new(sizeof(stack_region_t), stack_region_free_voidp);
+ xbt_dynar_t equals = xbt_dynar_new(sizeof(heap_equality_t), heap_equality_free_voidp);
+
+ void *heap1 = s1->regions[heap_index]->data, *heap2 = s2->regions[heap_index]->data;
+
+ if(mmalloc_compare_heap((xbt_mheap_t)s1->regions[heap_index]->data, (xbt_mheap_t)s2->regions[heap_index]->data, &stacks1, &stacks2, &equals)){
+
+ #ifdef MC_DEBUG
+ xbt_os_timer_stop(timer);
+ mc_comp_times->heap_comparison_time = xbt_os_timer_elapsed(timer);
+ XBT_DEBUG("Different heap (mmalloc_compare)");
+ errors++;
+ #else
+
+ xbt_os_timer_free(timer);
+ xbt_dynar_free(&stacks1);
+ xbt_dynar_free(&stacks2);
+ xbt_dynar_free(&equals);
+
+ #ifdef MC_VERBOSE
+ XBT_VERB("Different heap (mmalloc_compare)");
+ #endif
+
+ xbt_os_timer_stop(global_timer);
+ mc_snapshot_comparison_time = xbt_os_timer_elapsed(global_timer);
+ xbt_os_timer_free(global_timer);
+
+ if(!raw_mem)
+ MC_UNSET_RAW_MEM;
+
+ return 1;
+ #endif
+ }else{
+ #ifdef MC_DEBUG
+ xbt_os_timer_stop(timer);
+ #endif
+ }
+
+ #ifdef MC_DEBUG
+ xbt_os_timer_start(timer);
+ #endif
+