VirtualBox

Changeset 2004 in kBuild for trunk/src/kmk/variable.c


Ignore:
Timestamp:
Oct 30, 2008 12:01:41 AM (16 years ago)
Author:
bird
Message:

Some variable statistics.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk/variable.c

    r2003 r2004  
    281281                  v->value_alloc_len = VAR_ALIGN_VALUE_ALLOC (value_len + 1);
    282282                  v->value = xmalloc (v->value_alloc_len);
     283                  MAKE_STATS_2(v->reallocs++);
    283284                }
    284285              memcpy (v->value, value, value_len + 1);
     
    352353  v->append = 0;
    353354  v->export = v_default;
     355  MAKE_STATS_2(v->changes = 0);
     356  MAKE_STATS_2(v->reallocs = 0);
    354357
    355358  v->exportable = 1;
     
    433436      /* Make sure we have at least MAX bytes in the allocated buffer.  */
    434437      var->value = xrealloc (var->value, max);
     438      MAKE_STATS_2(var->reallocs++);
    435439
    436440      /* Walk through the hash of variables, constructing a list of names.  */
     
    451455                var->value = xrealloc (var->value, max);
    452456                p = &var->value[off];
     457                MAKE_STATS_2(var->reallocs++);
    453458              }
    454459
     
    16571662          v->value = new_buf;
    16581663        }
     1664      MAKE_STATS_2(v->reallocs++);
    16591665    }
    16601666
     
    18751881            if (free_value)
    18761882               free (free_value);
     1883            MAKE_STATS_2(v->changes++);
    18771884            return v;
    18781885#else /* !CONFIG_WITH_VALUE_LENGTH */
     
    20772084#endif
    20782085
     2086  MAKE_STATS_2(v->changes++);
    20792087  return v->special ? set_special_var (v) : v;
    20802088}
     
    23132321    printf (_(" (from `%s', line %lu)"),
    23142322            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));
    23152325  putchar ('\n');
    23162326  fputs (prefix, stdout);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette