Esempio n. 1
0
void    check_static(t_mar *mar, int c)
{
  if (mar->str[c + 7] == 'i' && mar->str[c + 8] == 'n'
      && mar->str[c + 9] == 't' && mar->str[c + 10] == ' ')
    print_static(c + 10, mar);
  else if (mar->str[c + 7] == 'c' && mar->str[c + 8] == 'h'
	   && mar->str[c + 9] == 'a' && mar->str[c + 10] == 'r'
	   && mar->str[c + 11] == ' ')
    print_static(c + 11, mar);
  else if (mar->str[c + 7] == 's' && mar->str[c + 8] == 'h'
           && mar->str[c + 9] == 'o' && mar->str[c + 10] == 'r'
           && mar->str[c + 11] == 't' && mar->str[c + 12] == ' ')
    print_static(c + 12, mar);
  else if (mar->str[c + 7] == 'd' && mar->str[c + 8] == 'o'
	   && mar->str[c + 9] == 'u' && mar->str[c + 10] == 'b'
	   && mar->str[c + 11] == 'l' && mar->str[c + 12] == 'e'
	   && mar->str[c + 13] == ' ')
    print_t(c + 13, mar);
  else if (mar->str[c + 7] == 'f' && mar->str[c + 8] == 'l'
	   && mar->str[c + 9] == 'o' && mar->str[c + 10] == 'a'
	   && mar->str[c + 11] == 't' && mar->str[c + 12] == ' ')
    print_t(c + 12, mar);
}
Esempio n. 2
0
void top_obj_show() {
   printf("PLT: %d\tNONPLT: %d\n", nb_plt, nb_non_plt);
   rbtree_key_val_arr_t *sorted = rbtree_sort(r, static_cmp);
   int i;
   for(i = 0; i < sorted->nb_elements; i++) {   
      print_static(sorted->vals[i]->key, sorted->vals[i]->value);
   }
   printf("Distant = %d (%.2f%%) avoidable by pining = %d (%.2f%%) and by alloc = %d (%.2f%%); %% of access to objects allocated by self=%5.2f%% (%d)\n", 
         distant,
         100.*(float)((float)distant)/((float)nb_total_access),
         pin_avoid,
         100.*(float)((float)pin_avoid)/((float)distant),
         bad_alloc,
         100.*(float)((float)bad_alloc)/((float)distant),
         100.*(float)((float)alloc_self)/((float)total_alloc),
         alloc_self
         );
}