Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/make make: in CLEANUP mode, free interned strings at...



details:   https://anonhg.NetBSD.org/src/rev/a46cd206f073
branches:  trunk
changeset: 1027679:a46cd206f073
user:      rillig <rillig%NetBSD.org@localhost>
date:      Wed Dec 15 10:57:01 2021 +0000

description:
make: in CLEANUP mode, free interned strings at the very end

Noticed by sjg.

diffstat:

 usr.bin/make/main.c |   5 +++--
 usr.bin/make/str.c  |  12 ++++++++++--
 usr.bin/make/str.h  |   3 ++-
 3 files changed, 15 insertions(+), 5 deletions(-)

diffs (74 lines):

diff -r 1c2f97c66819 -r a46cd206f073 usr.bin/make/main.c
--- a/usr.bin/make/main.c       Wed Dec 15 10:12:20 2021 +0000
+++ b/usr.bin/make/main.c       Wed Dec 15 10:57:01 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.543 2021/12/13 22:26:21 rillig Exp $        */
+/*     $NetBSD: main.c,v 1.544 2021/12/15 10:57:01 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -111,7 +111,7 @@
 #include "trace.h"
 
 /*     "@(#)main.c     8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: main.c,v 1.543 2021/12/13 22:26:21 rillig Exp $");
+MAKE_RCSID("$NetBSD: main.c,v 1.544 2021/12/15 10:57:01 rillig Exp $");
 #if defined(MAKE_NATIVE) && !defined(lint)
 __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 "
            "The Regents of the University of California.  "
@@ -1653,6 +1653,7 @@
        Dir_End();
        Job_End();
        Trace_End();
+       Str_Intern_End();
 }
 
 /* Determine the exit code. */
diff -r 1c2f97c66819 -r a46cd206f073 usr.bin/make/str.c
--- a/usr.bin/make/str.c        Wed Dec 15 10:12:20 2021 +0000
+++ b/usr.bin/make/str.c        Wed Dec 15 10:57:01 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: str.c,v 1.87 2021/12/13 05:25:04 rillig Exp $  */
+/*     $NetBSD: str.c,v 1.88 2021/12/15 10:57:01 rillig Exp $  */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -71,7 +71,7 @@
 #include "make.h"
 
 /*     "@(#)str.c      5.8 (Berkeley) 6/1/90"  */
-MAKE_RCSID("$NetBSD: str.c,v 1.87 2021/12/13 05:25:04 rillig Exp $");
+MAKE_RCSID("$NetBSD: str.c,v 1.88 2021/12/15 10:57:01 rillig Exp $");
 
 
 static HashTable interned_strings;
@@ -406,6 +406,14 @@
        HashTable_Init(&interned_strings);
 }
 
+void
+Str_Intern_End(void)
+{
+#ifdef CLEANUP
+       HashTable_Done(&interned_strings);
+#endif
+}
+
 /* Return a canonical instance of str, with unlimited lifetime. */
 const char *
 Str_Intern(const char *str)
diff -r 1c2f97c66819 -r a46cd206f073 usr.bin/make/str.h
--- a/usr.bin/make/str.h        Wed Dec 15 10:12:20 2021 +0000
+++ b/usr.bin/make/str.h        Wed Dec 15 10:57:01 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: str.h,v 1.14 2021/12/13 05:25:04 rillig Exp $  */
+/*     $NetBSD: str.h,v 1.15 2021/12/15 10:57:01 rillig Exp $  */
 
 /*
  Copyright (c) 2021 Roland Illig <rillig%NetBSD.org@localhost>
@@ -345,4 +345,5 @@
 bool Str_Match(const char *, const char *);
 
 void Str_Intern_Init(void);
+void Str_Intern_End(void);
 const char *Str_Intern(const char *);



Home | Main Index | Thread Index | Old Index