Changeset 2004 in kBuild for trunk/src/kmk/variable.c
- Timestamp:
- Oct 30, 2008 12:01:41 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk/variable.c
r2003 r2004 281 281 v->value_alloc_len = VAR_ALIGN_VALUE_ALLOC (value_len + 1); 282 282 v->value = xmalloc (v->value_alloc_len); 283 MAKE_STATS_2(v->reallocs++); 283 284 } 284 285 memcpy (v->value, value, value_len + 1); … … 352 353 v->append = 0; 353 354 v->export = v_default; 355 MAKE_STATS_2(v->changes = 0); 356 MAKE_STATS_2(v->reallocs = 0); 354 357 355 358 v->exportable = 1; … … 433 436 /* Make sure we have at least MAX bytes in the allocated buffer. */ 434 437 var->value = xrealloc (var->value, max); 438 MAKE_STATS_2(var->reallocs++); 435 439 436 440 /* Walk through the hash of variables, constructing a list of names. */ … … 451 455 var->value = xrealloc (var->value, max); 452 456 p = &var->value[off]; 457 MAKE_STATS_2(var->reallocs++); 453 458 } 454 459 … … 1657 1662 v->value = new_buf; 1658 1663 } 1664 MAKE_STATS_2(v->reallocs++); 1659 1665 } 1660 1666 … … 1875 1881 if (free_value) 1876 1882 free (free_value); 1883 MAKE_STATS_2(v->changes++); 1877 1884 return v; 1878 1885 #else /* !CONFIG_WITH_VALUE_LENGTH */ … … 2077 2084 #endif 2078 2085 2086 MAKE_STATS_2(v->changes++); 2079 2087 return v->special ? set_special_var (v) : v; 2080 2088 } … … 2313 2321 printf (_(" (from `%s', line %lu)"), 2314 2322 v->fileinfo.filenm, v->fileinfo.lineno); 2323 MAKE_STATS_2(if (v->changes != 1) printf(_(", %u changes"), v->changes)); 2324 MAKE_STATS_2(if (v->reallocs != 0) printf(_(", %u reallocs"), v->reallocs)); 2315 2325 putchar ('\n'); 2316 2326 fputs (prefix, stdout);
Note:
See TracChangeset
for help on using the changeset viewer.