summaryrefslogtreecommitdiff
path: root/make.h
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2007-03-20 03:02:26 +0000
committerPaul Smith <psmith@gnu.org>2007-03-20 03:02:26 +0000
commit6ccf33cdbdfda2aea5d51e4d4991881c74d853d1 (patch)
treece963770c6d0dc0428a6bce65d96da4b710e2831 /make.h
parente4da30858037b431880263676e8f90b1f8412a38 (diff)
downloadgunmake-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 'make.h')
-rw-r--r--make.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/make.h b/make.h
index 08f5543..35335f0 100644
--- a/make.h
+++ b/make.h
@@ -334,8 +334,8 @@ int strcmpi (const char *,const char *);
void sync_Path_environment (void);
int kill (int pid, int sig);
-char *end_of_token_w32 (char *s, char stopchar);
-int find_and_set_default_shell (char *token);
+char *end_of_token_w32 (const char *s, char stopchar);
+int find_and_set_default_shell (const char *token);
/* indicates whether or not we have Bourne shell */
extern int no_default_sh_exe;
@@ -385,7 +385,7 @@ char *concat (const char *, const char *, const char *);
void *xmalloc (unsigned int);
void *xrealloc (void *, unsigned int);
char *xstrdup (const char *);
-char *find_next_token (char **, unsigned int *);
+char *find_next_token (const char **, unsigned int *);
char *next_token (const char *);
char *end_of_token (const char *);
void collapse_continuations (char *);
@@ -393,6 +393,7 @@ char *lindex (const char *, const char *, int);
int alpha_compare (const void *, const void *);
void print_spaces (unsigned int);
char *find_percent (char *);
+const char *find_percent_cached (const char **);
FILE *open_tmpfile (char **, const char *);
#ifndef NO_ARCHIVES
@@ -427,10 +428,10 @@ void install_default_implicit_rules (void);
void build_vpath_lists (void);
void construct_vpath_list (char *pattern, char *dirpath);
-int vpath_search (char **file, FILE_TIMESTAMP *mtime_ptr);
+const char *vpath_search (const char *file, FILE_TIMESTAMP *mtime_ptr);
int gpath_search (const char *file, unsigned int len);
-void construct_include_path (char **arg_dirs);
+void construct_include_path (const char **arg_dirs);
void user_access (void);
void make_access (void);
@@ -585,5 +586,5 @@ extern int handling_fatal_signal;
NULL at the end of the directory--and _doesn't_ reset errno. So, we have
to do it ourselves here. */
-#define ENULLLOOP(_v,_c) do{ errno = 0; \
- while (((_v)=_c)==0 && errno==EINTR); }while(0)
+#define ENULLLOOP(_v,_c) do { errno = 0; (_v) = _c; } \
+ while((_v)==0 && errno==EINTR)