Changeset 1898 in kBuild
- Timestamp:
- Oct 21, 2008 1:39:22 AM (16 years ago)
- Location:
- trunk/src/kmk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk/commands.c
r1860 r1898 96 96 { 97 97 name = file->name; 98 #ifndef CONFIG_WITH_ VALUE_LENGTH98 #ifndef CONFIG_WITH_STRCACHE2 99 99 len = strlen (name); 100 100 #else 101 len = strcache _get_len (name);101 len = strcache2_get_len (&file_strcache, name); 102 102 #endif 103 103 } … … 105 105 for (d = enter_file (strcache_add (".SUFFIXES"))->deps; d ; d = d->next) 106 106 { 107 #ifndef CONFIG_WITH_ VALUE_LENGTH107 #ifndef CONFIG_WITH_STRCACHE2 108 108 unsigned int slen = strlen (dep_name (d)); 109 109 #else 110 unsigned int slen = strcache _get_len (dep_name (d));110 unsigned int slen = strcache2_get_len (&file_strcache, dep_name (d)); 111 111 #endif 112 112 if (len > slen && strneq (dep_name (d), name + (len - slen), slen)) … … 164 164 for (d = file->deps; d != 0; d = d->next) 165 165 if (! d->ignore_mtime) 166 #ifndef CONFIG_WITH_ VALUE_LENGTH166 #ifndef CONFIG_WITH_STRCACHE2 167 167 plus_len += strlen (dep_name (d)) + 1; 168 168 #else 169 plus_len += strcache _get_len (dep_name (d)) + 1;169 plus_len += strcache2_get_len (&file_strcache, dep_name (d)) + 1; 170 170 #endif 171 171 if (plus_len == 0) … … 190 190 else 191 191 #endif 192 #ifndef CONFIG_WITH_ VALUE_LENGTH192 #ifndef CONFIG_WITH_STRCACHE2 193 193 len = strlen (c); 194 194 #else 195 len = strcache _get_len (c);195 len = strcache2_get_len (&file_strcache, c); 196 196 #endif 197 197 … … 217 217 for (d = file->deps; d != 0; d = d->next) 218 218 if (d->ignore_mtime) 219 #ifndef CONFIG_WITH_ VALUE_LENGTH219 #ifndef CONFIG_WITH_STRCACHE2 220 220 bar_len += strlen (dep_name (d)) + 1; 221 221 #else 222 bar_len += strcache _get_len (dep_name (d)) + 1;222 bar_len += strcache2_get_len (&file_strcache, dep_name (d)) + 1; 223 223 #endif 224 224 if (bar_len == 0) … … 249 249 else 250 250 #endif 251 #ifndef CONFIG_WITH_ VALUE_LENGTH251 #ifndef CONFIG_WITH_STRCACHE2 252 252 len = strlen (c); 253 253 #else 254 len = strcache _get_len (c);254 len = strcache2_get_len (&file_strcache, c); 255 255 #endif 256 256 -
trunk/src/kmk/file.c
r1897 r1898 414 414 unsigned int len; 415 415 char *tmp_name = allocated_variable_expand_2 ( 416 f->name, strcache _get_len(f->name), &len);416 f->name, strcache2_get_len (&file_strcache, f->name), &len); 417 417 const char *name = strcache_add_len (tmp_name, len); 418 418 free (tmp_name); … … 619 619 p = variable_expand (""); 620 620 buffer_offset = p - variable_buffer; 621 #ifndef CONFIG_WITH_ VALUE_LENGTH621 #ifndef CONFIG_WITH_STRCACHE2 622 622 variable_buffer_output (p, d->name, strlen (d->name) + 1); 623 623 #else 624 len = strcache _get_len (d->name);624 len = strcache2_get_len (&file_strcache, d->name); 625 625 variable_buffer_output (p, d->name, len + 1); 626 626 #endif … … 660 660 set_file_variables (f); 661 661 662 #ifndef CONFIG_WITH_ VALUE_LENGTH662 #ifndef CONFIG_WITH_STRCACHE2 663 663 p = variable_expand_for_file (d->name, f); 664 664 #else 665 len = strcache _get_len (d->name);665 len = strcache2_get_len (&file_strcache, d->name); 666 666 p = variable_expand_for_file_2 (NULL, d->name, len, f, &len); 667 667 #endif … … 693 693 percent = find_percent (nm); 694 694 #else /* KMK - don't make a stack copy unless it's actually required! */ 695 unsigned int nl = strcache _get_len (dp->name);695 unsigned int nl = strcache2_get_len (&file_strcache, dp->name); 696 696 char *nm; 697 697 percent = memchr (dp->name, '%', nl); -
trunk/src/kmk/read.c
r1867 r1898 1540 1540 for (d2 = suffix_file->deps; d2 != 0; d2 = d2->next) 1541 1541 { 1542 #ifndef CONFIG_WITH_ VALUE_LENGTH1542 #ifndef CONFIG_WITH_STRCACHE2 1543 1543 unsigned int l = strlen (dep_name (d2)); 1544 1544 #else 1545 unsigned int l = strcache _get_len (dep_name (d2));1545 unsigned int l = strcache2_get_len (&file_strcache, dep_name (d2)); 1546 1546 #endif 1547 1547 if (!strneq (name, dep_name (d2), l)) … … 2154 2154 2155 2155 /* Remove duplicate dependencies in CHAIN. */ 2156 #ifndef CONFIG_WITH_ VALUE_LENGTH2156 #ifndef CONFIG_WITH_STRCACHE2 2157 2157 2158 2158 static unsigned long … … 2185 2185 } 2186 2186 2187 #else /* CONFIG_WITH_ VALUE_LENGTH*/2187 #else /* CONFIG_WITH_STRCACHE2 */ 2188 2188 2189 2189 /* Exploit the fact that all names are in the string cache. This means equal … … 2196 2196 { 2197 2197 const char *name = dep_name ((struct dep const *) key); 2198 assert (strcache _iscached (name));2198 assert (strcache2_is_cached (&file_strcache, name)); 2199 2199 return (size_t) name / sizeof(void *); 2200 2200 } … … 2204 2204 { 2205 2205 const char *name = dep_name ((struct dep const *) key); 2206 return strcache _get_len (name);2206 return strcache2_get_len (&file_strcache, name); 2207 2207 } 2208 2208 … … 2217 2217 2218 2218 /* check preconds: both cached and the cache contains no duplicates. */ 2219 assert (strcache _iscached (dxname));2220 assert (strcache _iscached (dyname));2219 assert (strcache2_is_cached (&file_strcache, dxname)); 2220 assert (strcache2_is_cached (&file_strcache, dyname)); 2221 2221 assert (cmp == 0 || strcmp (dxname, dyname) != 0); 2222 2222 … … 2231 2231 } 2232 2232 2233 #endif /* CONFIG_WITH_ VALUE_LENGTH*/2233 #endif /* CONFIG_WITH_STRCACHE2 */ 2234 2234 2235 2235 void
Note:
See TracChangeset
for help on using the changeset viewer.