diff options
author | Paul Smith <psmith@gnu.org> | 2007-03-20 03:02:26 +0000 |
---|---|---|
committer | Paul Smith <psmith@gnu.org> | 2007-03-20 03:02:26 +0000 |
commit | 6ccf33cdbdfda2aea5d51e4d4991881c74d853d1 (patch) | |
tree | ce963770c6d0dc0428a6bce65d96da4b710e2831 /default.c | |
parent | e4da30858037b431880263676e8f90b1f8412a38 (diff) | |
download | gunmake-6ccf33cdbdfda2aea5d51e4d4991881c74d853d1.tar.gz |
This is a major update, which switches virtually every allocated-but-not-freed
string into the strcache. As a side-effect, many more structure members and
function arguments can/should be declared const.
As mentioned in the changelog, unfortunately measurement shows that this
change does not yet reduce memory. The problem is with secondary expansion:
because of this we store all the prerequisites in the string cache twice.
First we store the prerequisite string after initial expansion but before
secondary expansion, then we store each individual file after secondary
expansion and expand_deps(). I plan to change expand_deps() to be callable
in either context (eval or snap_deps) then have non-second-expansion
targets call expand_deps() during eval, so that we only need to store that
dependency list once.
Diffstat (limited to 'default.c')
-rw-r--r-- | default.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -522,23 +522,23 @@ static const char *default_variables[] = void set_default_suffixes (void) { - suffix_file = enter_file (".SUFFIXES"); + suffix_file = enter_file (strcache_add (".SUFFIXES")); if (no_builtin_rules_flag) - (void) define_variable ("SUFFIXES", 8, "", o_default, 0); + define_variable ("SUFFIXES", 8, "", o_default, 0); else { char *p = default_suffixes; suffix_file->deps = (struct dep *) multi_glob (parse_file_seq (&p, '\0', sizeof (struct dep), 1), sizeof (struct dep)); - (void) define_variable ("SUFFIXES", 8, default_suffixes, o_default, 0); + define_variable ("SUFFIXES", 8, default_suffixes, o_default, 0); } } /* Enter the default suffix rules as file rules. This used to be done in install_default_implicit_rules, but that loses because we want the - suffix rules installed before reading makefiles, and thee pattern rules + suffix rules installed before reading makefiles, and the pattern rules installed after. */ void @@ -551,7 +551,7 @@ install_default_suffix_rules (void) for (s = default_suffix_rules; *s != 0; s += 2) { - struct file *f = enter_file (s[0]); + struct file *f = enter_file (strcache_add (s[0])); /* Don't clobber cmds given in a makefile if there were any. */ if (f->cmds == 0) { |