Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/make Don't bother iterating through all the data str...



details:   https://anonhg.NetBSD.org/src/rev/afe755dbc59f
branches:  trunk
changeset: 476376:afe755dbc59f
user:      mycroft <mycroft%NetBSD.org@localhost>
date:      Wed Sep 15 08:43:21 1999 +0000

description:
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:

 usr.bin/make/arch.c  |  12 +++++++++---
 usr.bin/make/dir.c   |   8 +++++---
 usr.bin/make/job.c   |   8 +++++---
 usr.bin/make/parse.c |  14 +++++++++++---
 usr.bin/make/suff.c  |  14 +++++++++++---
 usr.bin/make/targ.c  |  16 +++++++++++++---
 6 files changed, 54 insertions(+), 18 deletions(-)

diffs (truncated from 365 to 300 lines):

diff -r d67d0f3b1e14 -r afe755dbc59f usr.bin/make/arch.c
--- a/usr.bin/make/arch.c       Wed Sep 15 05:56:33 1999 +0000
+++ b/usr.bin/make/arch.c       Wed Sep 15 08:43:21 1999 +0000
@@ -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 @@
 } 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 int ArchSVR4Entry __P((Arch *, char *, size_t, FILE *));
 #endif
 
+#ifdef CLEANUP
 /*-
  *-----------------------------------------------------------------------
  * ArchFree --
@@ -175,6 +178,7 @@
     Hash_DeleteTable(&a->members);
     free((Address) a);
 }
+#endif
 
 
 
@@ -1265,7 +1269,9 @@
 void
 Arch_End ()
 {
+#ifdef CLEANUP
     Lst_Destroy(archives, ArchFree);
+#endif
 }
 
 /*-
diff -r d67d0f3b1e14 -r afe755dbc59f usr.bin/make/dir.c
--- a/usr.bin/make/dir.c        Wed Sep 15 05:56:33 1999 +0000
+++ b/usr.bin/make/dir.c        Wed Sep 15 08:43:21 1999 +0000
@@ -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 @@
 void
 Dir_End()
 {
+#ifdef CLEANUP
     if (cur) {
        cur->refCount -= 1;
        Dir_Destroy((ClientData) cur);
@@ -288,6 +289,7 @@
     Dir_ClearPath(openDirectories);
     Lst_Destroy(openDirectories, NOFREE);
     Hash_DeleteTable(&mtimes);
+#endif
 }
 
 /*-
diff -r d67d0f3b1e14 -r afe755dbc59f usr.bin/make/job.c
--- a/usr.bin/make/job.c        Wed Sep 15 05:56:33 1999 +0000
+++ b/usr.bin/make/job.c        Wed Sep 15 08:43:21 1999 +0000
@@ -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 @@
 void
 Job_End()
 {
+#ifdef CLEANUP
     if (shellArgv)
        free(shellArgv);
+#endif
 }
 
 /*-
diff -r d67d0f3b1e14 -r afe755dbc59f usr.bin/make/parse.c
--- a/usr.bin/make/parse.c      Wed Sep 15 05:56:33 1999 +0000
+++ b/usr.bin/make/parse.c      Wed Sep 15 08:43:21 1999 +0000
@@ -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 @@
 #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 @@
                         * 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 @@
     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 -r d67d0f3b1e14 -r afe755dbc59f usr.bin/make/suff.c
--- a/usr.bin/make/suff.c       Wed Sep 15 05:56:33 1999 +0000
+++ b/usr.bin/make/suff.c       Wed Sep 15 08:43:21 1999 +0000
@@ -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 @@
 #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 @@
 void
 Suff_ClearSuffixes ()
 {
+#ifdef CLEANUP
     Lst_Concat (suffClean, sufflist, LST_CONCLINK);
+#endif
     sufflist = Lst_Init(FALSE);
     sNum = 0;
     suffNull = emptySuff;
@@ -2423,7 +2427,9 @@
 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 @@
 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 -r d67d0f3b1e14 -r afe755dbc59f usr.bin/make/targ.c
--- a/usr.bin/make/targ.c       Wed Sep 15 05:56:33 1999 +0000
+++ b/usr.bin/make/targ.c       Wed Sep 15 08:43:21 1999 +0000
@@ -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



Home | Main Index | Thread Index | Old Index