From cc4cf4da2b448e948d520e8013e95acd09405205 Mon Sep 17 00:00:00 2001 From: Marc Espie Date: Tue, 5 Oct 1999 22:06:25 +0000 Subject: Efficiency patch from NetBSD: make spends time freeing data structures right before exiting. So don't bother. Keep the code inside #ifdef, so that it's still there if someone ever wants to use make code inside a library. --- usr.bin/make/suff.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'usr.bin/make/suff.c') diff --git a/usr.bin/make/suff.c b/usr.bin/make/suff.c index bcf8bb7ab08..cba847e3103 100644 --- a/usr.bin/make/suff.c +++ b/usr.bin/make/suff.c @@ -1,4 +1,4 @@ -/* $OpenBSD: suff.c,v 1.13 1999/03/06 20:27:40 millert Exp $ */ +/* $OpenBSD: suff.c,v 1.14 1999/10/05 22:06:24 espie Exp $ */ /* $NetBSD: suff.c,v 1.13 1996/11/06 17:59:25 christos Exp $ */ /* @@ -43,7 +43,7 @@ #if 0 static char sccsid[] = "@(#)suff.c 8.4 (Berkeley) 3/21/94"; #else -static char rcsid[] = "$OpenBSD: suff.c,v 1.13 1999/03/06 20:27:40 millert Exp $"; +static char rcsid[] = "$OpenBSD: suff.c,v 1.14 1999/10/05 22:06:24 espie Exp $"; #endif #endif /* not lint */ @@ -104,7 +104,9 @@ static char rcsid[] = "$OpenBSD: suff.c,v 1.13 1999/03/06 20:27:40 millert Exp $ #include "dir.h" static Lst sufflist; /* Lst of suffixes */ +#ifdef CLEANUP static Lst suffClean; /* Lst of suffixes to be cleaned */ +#endif static Lst srclist; /* Lst of sources */ static Lst transforms; /* Lst of transformation rules */ @@ -487,7 +489,9 @@ SuffInsert (l, s) void Suff_ClearSuffixes () { +#ifdef CLEANUP Lst_Concat (suffClean, sufflist, LST_CONCLINK); +#endif sufflist = Lst_Init(FALSE); sNum = 0; suffNull = emptySuff; @@ -2334,7 +2338,9 @@ void Suff_Init () { sufflist = Lst_Init (FALSE); +#ifdef CLEANUP suffClean = Lst_Init(FALSE); +#endif srclist = Lst_Init (FALSE); transforms = Lst_Init (FALSE); @@ -2376,12 +2382,14 @@ Suff_Init () void Suff_End() { +#ifdef CLEANUP Lst_Destroy(sufflist, SuffFree); Lst_Destroy(suffClean, SuffFree); if (suffNull) SuffFree(suffNull); Lst_Destroy(srclist, NOFREE); Lst_Destroy(transforms, NOFREE); +#endif } -- cgit v1.2.3