diff options
author | Paul Smith <psmith@gnu.org> | 2009-09-24 02:41:44 +0000 |
---|---|---|
committer | Paul Smith <psmith@gnu.org> | 2009-09-24 02:41:44 +0000 |
commit | 0afbbf8595b6035a5a930399d20320d2e2852d72 (patch) | |
tree | 6c74d485e4d57b2bf41bb5d6afaac1b4569dd554 /commands.c | |
parent | 3cc351decdd7d53fea0c730fd919163f20706762 (diff) | |
download | gunmake-0afbbf8595b6035a5a930399d20320d2e2852d72.tar.gz |
- Rework secondary expansion so we only defer it if there's a possibility
it might be needed: for most situations we parse prereqs immediately as
we used to. Reduces memory usage.
- Fixes Savannah bug #18622.
Diffstat (limited to 'commands.c')
-rw-r--r-- | commands.c | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -116,7 +116,8 @@ set_file_variables (struct file *file) for (d = file->deps; d != 0; d = d->next) if (!d->ignore_mtime) { - less = dep_name (d); + if (!d->need_2nd_expansion) + less = dep_name (d); break; } @@ -153,7 +154,7 @@ set_file_variables (struct file *file) plus_len = 0; for (d = file->deps; d != 0; d = d->next) - if (! d->ignore_mtime) + if (! d->ignore_mtime && ! d->need_2nd_expansion) plus_len += strlen (dep_name (d)) + 1; if (plus_len == 0) plus_len++; @@ -164,7 +165,7 @@ set_file_variables (struct file *file) qmark_len = plus_len + 1; /* Will be this or less. */ for (d = file->deps; d != 0; d = d->next) - if (! d->ignore_mtime) + if (! d->ignore_mtime && ! d->need_2nd_expansion) { const char *c = dep_name (d); @@ -198,7 +199,7 @@ set_file_variables (struct file *file) bar_len = 0; for (d = file->deps; d != 0; d = d->next) - if (d->ignore_mtime) + if (d->ignore_mtime && ! d->need_2nd_expansion) bar_len += strlen (dep_name (d)) + 1; if (bar_len == 0) bar_len++; @@ -217,8 +218,12 @@ set_file_variables (struct file *file) for (d = file->deps; d != 0; d = d->next) { - const char *c = dep_name (d); + const char *c; + if (d->need_2nd_expansion) + continue; + + c = dep_name (d); #ifndef NO_ARCHIVES if (ar_name (c)) { |