]> git.ipfire.org Git - thirdparty/make.git/commit
Fix performance degradation introduced by the second expansion feature.
authorPaul Smith <psmith@gnu.org>
Wed, 13 Apr 2005 03:16:33 +0000 (03:16 +0000)
committerPaul Smith <psmith@gnu.org>
Wed, 13 Apr 2005 03:16:33 +0000 (03:16 +0000)
commit49ee105c685cb84bc3057e8b7666fc0cc7090047
tree178eec81c5e39f56db9ca4b513376b3e1c5d35bf
parent3daf8df6ee835b9edcc068af33ae97910bb8d934
Fix performance degradation introduced by the second expansion feature.
I did this by adding intelligence into the algorithm such that the
second expansion was only actually performed when the prerequisite list
contained at least one "$", so we knew it is actually needed.

Without this we were using up a LOT more memory, since every single
target (even ones never used by make) had their file variables
initialized.  This also used a lot more CPU, since we needed to create
and populate a new variable hash table for every target.

There is one issue remaining with this feature: it leaks memory.  In
pattern_search() we now initialize the file variables for every pattern
target, which allocates a hash table, etc.  However, sometimes we
recursively invoke pattern_search() (for intermediate files) with an
automatic variable (alloca() I believe) as the file.  When that function
returns, obviously, the file variable hash memory is lost.
ChangeLog
dep.h
file.c
implicit.c
main.c
read.c
rule.c