diff options
| author | mycroft <mycroft@NetBSD.org> | 1999-09-15 08:43:21 +0000 |
|---|---|---|
| committer | mycroft <mycroft@NetBSD.org> | 1999-09-15 08:43:21 +0000 |
| commit | dd291116bc06e2dc513da8bd7bf3ec31d3f875f7 (patch) | |
| tree | 2a354915f78d47cb298fe594acbb006fc89085c7 /usr.bin/make | |
| parent | 441a442e4629dbb5ff4935ea50cca72f0ca864bf (diff) | |
Don't bother iterating through all the data structures to free(3) everything
right before exiting.
(The code is still present, `#ifdef CLEANUP', in case someone needs it...)
Diffstat (limited to 'usr.bin/make')
| -rw-r--r-- | usr.bin/make/arch.c | 12 | ||||
| -rw-r--r-- | usr.bin/make/dir.c | 8 | ||||
| -rw-r--r-- | usr.bin/make/job.c | 8 | ||||
| -rw-r--r-- | usr.bin/make/parse.c | 14 | ||||
| -rw-r--r-- | usr.bin/make/suff.c | 14 | ||||
| -rw-r--r-- | usr.bin/make/targ.c | 16 |
6 files changed, 54 insertions, 18 deletions
diff --git a/usr.bin/make/arch.c b/usr.bin/make/arch.c index 9b93a6a4e62..7a9990576ec 100644 --- a/usr.bin/make/arch.c +++ b/usr.bin/make/arch.c @@ -1,4 +1,4 @@ -/* $NetBSD: arch.c,v 1.30 1999/09/04 04:21:28 christos Exp $ */ +/* $NetBSD: arch.c,v 1.31 1999/09/15 08:43:21 mycroft Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -39,14 +39,14 @@ */ #ifdef MAKE_BOOTSTRAP -static char rcsid[] = "$NetBSD: arch.c,v 1.30 1999/09/04 04:21:28 christos Exp $"; +static char rcsid[] = "$NetBSD: arch.c,v 1.31 1999/09/15 08:43:21 mycroft Exp $"; #else #include <sys/cdefs.h> #ifndef lint #if 0 static char sccsid[] = "@(#)arch.c 8.2 (Berkeley) 1/2/94"; #else -__RCSID("$NetBSD: arch.c,v 1.30 1999/09/04 04:21:28 christos Exp $"); +__RCSID("$NetBSD: arch.c,v 1.31 1999/09/15 08:43:21 mycroft Exp $"); #endif #endif /* not lint */ #endif @@ -134,7 +134,9 @@ typedef struct Arch { } Arch; static int ArchFindArchive __P((ClientData, ClientData)); +#ifdef CLEANUP static void ArchFree __P((ClientData)); +#endif static struct ar_hdr *ArchStatMember __P((char *, char *, Boolean)); static FILE *ArchFindMember __P((char *, char *, struct ar_hdr *, char *)); #if defined(__svr4__) || defined(__SVR4) || defined(__ELF__) @@ -142,6 +144,7 @@ static FILE *ArchFindMember __P((char *, char *, struct ar_hdr *, char *)); static int ArchSVR4Entry __P((Arch *, char *, size_t, FILE *)); #endif +#ifdef CLEANUP /*- *----------------------------------------------------------------------- * ArchFree -- @@ -175,6 +178,7 @@ ArchFree(ap) Hash_DeleteTable(&a->members); free((Address) a); } +#endif @@ -1265,7 +1269,9 @@ Arch_Init () void Arch_End () { +#ifdef CLEANUP Lst_Destroy(archives, ArchFree); +#endif } /*- diff --git a/usr.bin/make/dir.c b/usr.bin/make/dir.c index 6898bc8f2fd..18a4341b97a 100644 --- a/usr.bin/make/dir.c +++ b/usr.bin/make/dir.c @@ -1,4 +1,4 @@ -/* $NetBSD: dir.c,v 1.23 1999/09/15 05:56:33 mycroft Exp $ */ +/* $NetBSD: dir.c,v 1.24 1999/09/15 08:43:22 mycroft Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -39,14 +39,14 @@ */ #ifdef MAKE_BOOTSTRAP -static char rcsid[] = "$NetBSD: dir.c,v 1.23 1999/09/15 05:56:33 mycroft Exp $"; +static char rcsid[] = "$NetBSD: dir.c,v 1.24 1999/09/15 08:43:22 mycroft Exp $"; #else #include <sys/cdefs.h> #ifndef lint #if 0 static char sccsid[] = "@(#)dir.c 8.2 (Berkeley) 1/2/94"; #else -__RCSID("$NetBSD: dir.c,v 1.23 1999/09/15 05:56:33 mycroft Exp $"); +__RCSID("$NetBSD: dir.c,v 1.24 1999/09/15 08:43:22 mycroft Exp $"); #endif #endif /* not lint */ #endif @@ -275,6 +275,7 @@ Dir_Init (cdname) void Dir_End() { +#ifdef CLEANUP if (cur) { cur->refCount -= 1; Dir_Destroy((ClientData) cur); @@ -288,6 +289,7 @@ Dir_End() Dir_ClearPath(openDirectories); Lst_Destroy(openDirectories, NOFREE); Hash_DeleteTable(&mtimes); +#endif } /*- diff --git a/usr.bin/make/job.c b/usr.bin/make/job.c index 7584ad7a3dd..7379057e8ae 100644 --- a/usr.bin/make/job.c +++ b/usr.bin/make/job.c @@ -1,4 +1,4 @@ -/* $NetBSD: job.c,v 1.29 1999/09/04 04:21:28 christos Exp $ */ +/* $NetBSD: job.c,v 1.30 1999/09/15 08:43:22 mycroft Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -39,14 +39,14 @@ */ #ifdef MAKE_BOOTSTRAP -static char rcsid[] = "$NetBSD: job.c,v 1.29 1999/09/04 04:21:28 christos Exp $"; +static char rcsid[] = "$NetBSD: job.c,v 1.30 1999/09/15 08:43:22 mycroft Exp $"; #else #include <sys/cdefs.h> #ifndef lint #if 0 static char sccsid[] = "@(#)job.c 8.2 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: job.c,v 1.29 1999/09/04 04:21:28 christos Exp $"); +__RCSID("$NetBSD: job.c,v 1.30 1999/09/15 08:43:22 mycroft Exp $"); #endif #endif /* not lint */ #endif @@ -2988,8 +2988,10 @@ Job_Finish() void Job_End() { +#ifdef CLEANUP if (shellArgv) free(shellArgv); +#endif } /*- diff --git a/usr.bin/make/parse.c b/usr.bin/make/parse.c index 29ff07cb2dd..fe1a8be3fff 100644 --- a/usr.bin/make/parse.c +++ b/usr.bin/make/parse.c @@ -1,4 +1,4 @@ -/* $NetBSD: parse.c,v 1.44 1999/08/09 21:06:28 aidan Exp $ */ +/* $NetBSD: parse.c,v 1.45 1999/09/15 08:43:22 mycroft Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -39,14 +39,14 @@ */ #ifdef MAKE_BOOTSTRAP -static char rcsid[] = "$NetBSD: parse.c,v 1.44 1999/08/09 21:06:28 aidan Exp $"; +static char rcsid[] = "$NetBSD: parse.c,v 1.45 1999/09/15 08:43:22 mycroft Exp $"; #else #include <sys/cdefs.h> #ifndef lint #if 0 static char sccsid[] = "@(#)parse.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: parse.c,v 1.44 1999/08/09 21:06:28 aidan Exp $"); +__RCSID("$NetBSD: parse.c,v 1.45 1999/09/15 08:43:22 mycroft Exp $"); #endif #endif /* not lint */ #endif @@ -116,7 +116,9 @@ __RCSID("$NetBSD: parse.c,v 1.44 1999/08/09 21:06:28 aidan Exp $"); #define CONTINUE 1 #define DONE 0 static Lst targets; /* targets we're working on */ +#ifdef CLEANUP static Lst targCmds; /* command lines for targets */ +#endif static Boolean inLine; /* true if currently in a dependency * line or its commands */ typedef struct { @@ -2574,7 +2576,9 @@ Parse_File(name, stream) * commands of all targets in the dependency spec */ Lst_ForEach (targets, ParseAddCmd, cp); +#ifdef CLEANUP Lst_AtEnd(targCmds, (ClientData) line); +#endif continue; } else { Parse_Error (PARSE_FATAL, @@ -2700,18 +2704,22 @@ Parse_Init () parseIncPath = Lst_Init (FALSE); sysIncPath = Lst_Init (FALSE); includes = Lst_Init (FALSE); +#ifdef CLEANUP targCmds = Lst_Init (FALSE); +#endif } void Parse_End() { +#ifdef CLEANUP Lst_Destroy(targCmds, (void (*) __P((ClientData))) free); if (targets) Lst_Destroy(targets, NOFREE); Lst_Destroy(sysIncPath, Dir_Destroy); Lst_Destroy(parseIncPath, Dir_Destroy); Lst_Destroy(includes, NOFREE); /* Should be empty now */ +#endif } diff --git a/usr.bin/make/suff.c b/usr.bin/make/suff.c index 3ae6977b07f..1547de621fa 100644 --- a/usr.bin/make/suff.c +++ b/usr.bin/make/suff.c @@ -1,4 +1,4 @@ -/* $NetBSD: suff.c,v 1.24 1999/09/15 03:59:44 mycroft Exp $ */ +/* $NetBSD: suff.c,v 1.25 1999/09/15 08:43:22 mycroft Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -39,14 +39,14 @@ */ #ifdef MAKE_BOOTSTRAP -static char rcsid[] = "$NetBSD: suff.c,v 1.24 1999/09/15 03:59:44 mycroft Exp $"; +static char rcsid[] = "$NetBSD: suff.c,v 1.25 1999/09/15 08:43:22 mycroft Exp $"; #else #include <sys/cdefs.h> #ifndef lint #if 0 static char sccsid[] = "@(#)suff.c 8.4 (Berkeley) 3/21/94"; #else -__RCSID("$NetBSD: suff.c,v 1.24 1999/09/15 03:59:44 mycroft Exp $"); +__RCSID("$NetBSD: suff.c,v 1.25 1999/09/15 08:43:22 mycroft Exp $"); #endif #endif /* not lint */ #endif @@ -108,7 +108,9 @@ __RCSID("$NetBSD: suff.c,v 1.24 1999/09/15 03:59:44 mycroft 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 */ @@ -507,7 +509,9 @@ SuffInsert (l, s) void Suff_ClearSuffixes () { +#ifdef CLEANUP Lst_Concat (suffClean, sufflist, LST_CONCLINK); +#endif sufflist = Lst_Init(FALSE); sNum = 0; suffNull = emptySuff; @@ -2423,7 +2427,9 @@ void Suff_Init () { sufflist = Lst_Init (FALSE); +#ifdef CLEANUP suffClean = Lst_Init(FALSE); +#endif srclist = Lst_Init (FALSE); transforms = Lst_Init (FALSE); @@ -2465,12 +2471,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 } diff --git a/usr.bin/make/targ.c b/usr.bin/make/targ.c index 8106cb834b5..e5140a145cd 100644 --- a/usr.bin/make/targ.c +++ b/usr.bin/make/targ.c @@ -1,4 +1,4 @@ -/* $NetBSD: targ.c,v 1.17 1999/09/15 02:56:35 mycroft Exp $ */ +/* $NetBSD: targ.c,v 1.18 1999/09/15 08:43:22 mycroft Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -39,14 +39,14 @@ */ #ifdef MAKE_BOOTSTRAP -static char rcsid[] = "$NetBSD: targ.c,v 1.17 1999/09/15 02:56:35 mycroft Exp $"; +static char rcsid[] = "$NetBSD: targ.c,v 1.18 1999/09/15 08:43:22 mycroft Exp $"; #else #include <sys/cdefs.h> #ifndef lint #if 0 static char sccsid[] = "@(#)targ.c 8.2 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: targ.c,v 1.17 1999/09/15 02:56:35 mycroft Exp $"); +__RCSID("$NetBSD: targ.c,v 1.18 1999/09/15 08:43:22 mycroft Exp $"); #endif #endif /* not lint */ #endif @@ -101,7 +101,9 @@ __RCSID("$NetBSD: targ.c,v 1.17 1999/09/15 02:56:35 mycroft Exp $"); #include "dir.h" static Lst allTargets; /* the list of all targets found so far */ +#ifdef CLEANUP static Lst allGNs; /* List of all the GNodes */ +#endif static Hash_Table targets; /* a hash table of same */ #define HTSIZE 191 /* initial size of hash table */ @@ -109,7 +111,9 @@ static Hash_Table targets; /* a hash table of same */ static int TargPrintOnlySrc __P((ClientData, ClientData)); static int TargPrintName __P((ClientData, ClientData)); static int TargPrintNode __P((ClientData, ClientData)); +#ifdef CLEANUP static void TargFreeGN __P((ClientData)); +#endif /*- *----------------------------------------------------------------------- @@ -145,10 +149,12 @@ Targ_Init () void Targ_End () { +#ifdef CLEANUP Lst_Destroy(allTargets, NOFREE); if (allGNs) Lst_Destroy(allGNs, TargFreeGN); Hash_DeleteTable(&targets); +#endif } /*- @@ -212,13 +218,16 @@ Targ_NewGN (name) gn->commands = Lst_Init (FALSE); gn->suffix = NULL; +#ifdef CLEANUP if (allGNs == NULL) allGNs = Lst_Init(FALSE); Lst_AtEnd(allGNs, (ClientData) gn); +#endif return (gn); } +#ifdef CLEANUP /*- *----------------------------------------------------------------------- * TargFreeGN -- @@ -254,6 +263,7 @@ TargFreeGN (gnp) Lst_Destroy(gn->commands, NOFREE); free((Address)gn); } +#endif /*- |
