Changeset 2006 in kBuild
- Timestamp:
- Oct 30, 2008 2:15:35 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk/variable.c
r2005 r2006 1645 1645 v->value_alloc_len *= 2; 1646 1646 if (v->value_alloc_len < new_value_len + 1) 1647 v->value_alloc_len = VAR_ALIGN_VALUE_ALLOC (new_value_len + 1 + value_len ); /* extra for future */1647 v->value_alloc_len = VAR_ALIGN_VALUE_ALLOC (new_value_len + 1 + value_len /*future*/ ); 1648 1648 # ifdef CONFIG_WITH_RDONLY_VARIABLE_VALUE 1649 1649 if ((append || !v->value_length) && !v->rdonly_val) … … 2281 2281 static unsigned long var_stats_changes, var_stats_changed; 2282 2282 static unsigned long var_stats_reallocs, var_stats_realloced; 2283 static unsigned long var_stats_val_len, var_stats_val_alloc_len; 2284 static unsigned long var_stats_val_rdonly_len; 2283 2285 #endif 2284 2286 … … 2331 2333 #ifdef CONFIG_WITH_MAKE_STATS 2332 2334 if (v->changes != 0) 2333 printf (_(", %u changes"), v->changes);2335 printf (_(", %u changes"), v->changes); 2334 2336 var_stats_changes += v->changes; 2335 2337 var_stats_changed += (v->changes != 0); 2336 2338 if (v->reallocs != 0) 2337 printf (_(", %u reallocs"), v->reallocs);2339 printf (_(", %u reallocs"), v->reallocs); 2338 2340 var_stats_reallocs += v->reallocs; 2339 2341 var_stats_realloced += (v->reallocs != 0); 2342 var_stats_val_len += v->value_length; 2343 if (v->value_alloc_len) 2344 var_stats_val_alloc_len += v->value_alloc_len; 2345 else 2346 var_stats_val_rdonly_len += v->value_length; 2347 assert (v->value_length == strlen (v->value)); 2348 /*assert (v->rdonly_val ? !v->value_alloc_len : v->value_alloc_len > v->value_length); - FIXME */ 2340 2349 #endif /* CONFIG_WITH_MAKE_STATS */ 2341 2350 putchar ('\n'); … … 2379 2388 #ifdef CONFIG_WITH_MAKE_STATS 2380 2389 var_stats_changes = var_stats_changed = var_stats_reallocs 2381 = var_stats_realloced = 0; 2390 = var_stats_realloced = var_stats_val_len = var_stats_val_alloc_len 2391 = var_stats_val_rdonly_len = 0; 2382 2392 2383 2393 hash_map_arg (&set->table, print_variable, prefix); 2384 2394 2385 if (var_stats_changed || var_stats_realloced) 2386 printf(_("# variable set modification stats:\n")); 2387 if (var_stats_changed) 2388 printf(_("# changed %5lu (%2u%%), changes %6lu\n"), 2389 var_stats_changed, 2390 (unsigned int)((100.0 * var_stats_changed) / set->table.ht_fill), 2391 var_stats_changes); 2392 if (var_stats_realloced) 2393 printf(_("# reallocated %5lu (%2u%%), reallocations %6lu\n"), 2394 var_stats_realloced, 2395 (unsigned int)((100.0 * var_stats_realloced) / set->table.ht_fill), 2396 var_stats_reallocs); 2395 if (set->table.ht_fill) 2396 { 2397 unsigned long fragmentation; 2398 2399 fragmentation = var_stats_val_alloc_len - (var_stats_val_len - var_stats_val_rdonly_len); 2400 printf(_("# variable set value stats:\n\ 2401 # strings %7lu bytes, readonly %6lu bytes\n"), 2402 var_stats_val_len, var_stats_val_rdonly_len, var_stats_val_alloc_len); 2403 2404 if (var_stats_val_alloc_len) 2405 printf(_("# allocated %7lu bytes, fragmentation %6lu bytes (%u%%)\n"), 2406 var_stats_val_alloc_len, fragmentation, 2407 (unsigned int)((100.0 * fragmentation) / var_stats_val_alloc_len)); 2408 2409 if (var_stats_changed) 2410 printf(_("# changed %5lu (%2u%%), changes %6lu\n"), 2411 var_stats_changed, 2412 (unsigned int)((100.0 * var_stats_changed) / set->table.ht_fill), 2413 var_stats_changes); 2414 2415 if (var_stats_realloced) 2416 printf(_("# reallocated %5lu (%2u%%), reallocations %6lu\n"), 2417 var_stats_realloced, 2418 (unsigned int)((100.0 * var_stats_realloced) / set->table.ht_fill), 2419 var_stats_reallocs); 2420 } 2397 2421 #else 2398 2422 hash_map_arg (&set->table, print_variable, prefix);
Note:
See TracChangeset
for help on using the changeset viewer.