- xbt_dynar_t s_tokens1, s_tokens2;
- unsigned int cursor = 0;
- void *addr1, *addr2;
- char *ip1 = NULL, *ip2 = NULL;
-
- while(cursor < xbt_dynar_length(tokens1)){
- s_tokens1 = xbt_str_split(xbt_dynar_get_as(tokens1, cursor, char *), "=");
- s_tokens2 = xbt_str_split(xbt_dynar_get_as(tokens2, cursor, char *), "=");
- if(xbt_dynar_length(s_tokens1) > 1 && xbt_dynar_length(s_tokens2) > 1){
- if((strcmp(xbt_dynar_get_as(s_tokens1, 0, char *), "ip") == 0) && (strcmp(xbt_dynar_get_as(s_tokens2, 0, char *), "ip") == 0)){
- ip1 = strdup(xbt_dynar_get_as(s_tokens1, 1, char *));
- ip2 = strdup(xbt_dynar_get_as(s_tokens2, 1, char *));
- /*if(XBT_LOG_ISENABLED(mc_compare, xbt_log_priority_verbose))
- XBT_VERB("Instruction pointer : %s, Instruction pointer : %s", ip1, ip2);*/
- }
- if(strcmp(xbt_dynar_get_as(s_tokens1, 1, char *), xbt_dynar_get_as(s_tokens2, 1, char *)) != 0){
- /* Ignore this variable ? */
- if(is_stack_ignore_variable(ip1, xbt_dynar_get_as(s_tokens1, 0, char *)) && is_stack_ignore_variable(ip2, xbt_dynar_get_as(s_tokens2, 0, char *))){
- xbt_dynar_free(&s_tokens1);
- xbt_dynar_free(&s_tokens2);
- cursor++;
- continue;
- }
- addr1 = (void *) strtoul(xbt_dynar_get_as(s_tokens1, 1, char *), NULL, 16);
- addr2 = (void *) strtoul(xbt_dynar_get_as(s_tokens2, 1, char *), NULL, 16);
- if(is_heap_equality(heap_equals, addr1, addr2) == 0){
- if(XBT_LOG_ISENABLED(mc_compare, xbt_log_priority_verbose))
- XBT_VERB("Variable %s is different between stacks : %s - %s", xbt_dynar_get_as(s_tokens1, 0, char *), xbt_dynar_get_as(s_tokens1, 1, char *), xbt_dynar_get_as(s_tokens2, 1, char *));
- xbt_dynar_free(&s_tokens1);
- xbt_dynar_free(&s_tokens2);
- return 1;
- }
- }
- }
- xbt_dynar_free(&s_tokens1);
- xbt_dynar_free(&s_tokens2);
- cursor++;
+ #ifdef MC_DEBUG
+ xbt_os_walltimer_stop(timer);
+ mc_comp_times->heap_comparison_time = xbt_os_timer_elapsed(timer);
+ XBT_DEBUG("(%d - %d) Different heap (mmalloc_compare)", num1, num2);
+ errors++;
+ #else
+
+ #ifdef MC_VERBOSE
+ XBT_VERB("(%d - %d) Different heap (mmalloc_compare)", num1, num2);
+ #endif
+
+ reset_heap_information();
+ xbt_os_walltimer_stop(timer);
+ xbt_os_timer_free(timer);
+ xbt_os_walltimer_stop(global_timer);
+ mc_snapshot_comparison_time = xbt_os_timer_elapsed(global_timer);
+ xbt_os_timer_free(global_timer);
+
+ return 1;
+ #endif
+ }else{
+ #ifdef MC_DEBUG
+ xbt_os_walltimer_stop(timer);
+ #endif