Ignore:
Timestamp:
Sep 17, 2006, 10:38:57 PM (19 years ago)
Author:
bird
Message:

Added kBuild specific functions for speeding up source processing.

File:
1 edited

Legend:

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

    r527 r530  
    351351      if ((int) origin >= (int) v->origin)
    352352        {
    353           if (v->value != 0)
    354             free (v->value);
     353#ifdef CONFIG_WITH_VALUE_LENGTH
     354          v->value_length = strlen (value);
     355          v->value = xrealloc (v->value, v->value_length + 1);
     356          bcopy (value, v->value, v->value_length + 1);
     357#else
     358          if (v->value != 0)
     359            free (v->value);
    355360          v->value = xstrdup (value);
     361#endif
    356362          if (flocp != 0)
    357363            v->fileinfo = *flocp;
     
    374380#endif
    375381  hash_insert_at (&set->table, v, var_slot);
     382#ifdef CONFIG_WITH_VALUE_LENGTH
     383  v->value_length = strlen (value);
     384  v->value = xmalloc (v->value_length + 1);
     385  bcopy (value, v->value, v->value_length + 1);
     386#else
    376387  v->value = xstrdup (value);
     388#endif
    377389  if (flocp != 0)
    378390    v->fileinfo = *flocp;
     
    10311043      v->origin = o_file;
    10321044      v->value = xstrdup (default_shell);
     1045#ifdef CONFIG_WITH_VALUE_LENGTH
     1046      v->value_length = -1;
     1047#endif
    10331048    }
    10341049#endif
     
    13051320              val = alloc_value = allocated_variable_expand (val);
    13061321
    1307             oldlen = strlen (v->value);
     1322#ifdef CONFIG_WITH_VALUE_LENGTH
     1323            oldlen = v->value_length;
     1324            assert(oldlen == strlen (v->value));
     1325#endif
    13081326            vallen = strlen (val);
    13091327            p = (char *) alloca (oldlen + 1 + vallen + 1);
     
    15381556  p = next_token (p);
    15391557  v->value = p;
     1558#ifdef CONFIG_WITH_VALUE_LENGTH
     1559  v->value_length = -1;
     1560#endif
    15401561
    15411562  /* Expand the name, so "$(foo)bar = baz" works.  */
Note: See TracChangeset for help on using the changeset viewer.