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(1): clean up reference counting in SuffLis...



details:   https://anonhg.NetBSD.org/src/rev/04508d68dbf7
branches:  trunk
changeset: 946213:04508d68dbf7
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Nov 21 13:20:12 2020 +0000

description:
make(1): clean up reference counting in SuffList_Insert

diffstat:

 usr.bin/make/suff.c |  10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diffs (35 lines):

diff -r 867504782420 -r 04508d68dbf7 usr.bin/make/suff.c
--- a/usr.bin/make/suff.c       Sat Nov 21 13:16:37 2020 +0000
+++ b/usr.bin/make/suff.c       Sat Nov 21 13:20:12 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: suff.c,v 1.260 2020/11/21 13:16:37 rillig Exp $        */
+/*     $NetBSD: suff.c,v 1.261 2020/11/21 13:20:12 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -114,7 +114,7 @@
 #include "dir.h"
 
 /*     "@(#)suff.c     8.4 (Berkeley) 3/21/94" */
-MAKE_RCSID("$NetBSD: suff.c,v 1.260 2020/11/21 13:16:37 rillig Exp $");
+MAKE_RCSID("$NetBSD: suff.c,v 1.261 2020/11/21 13:20:12 rillig Exp $");
 
 #define SUFF_DEBUG0(text) DEBUG0(SUFF, text)
 #define SUFF_DEBUG1(fmt, arg1) DEBUG1(SUFF, fmt, arg1)
@@ -374,14 +374,12 @@
     if (ln == NULL) {
        SUFF_DEBUG2("inserting \"%s\" (%d) at end of list\n",
                    suff->name, suff->sNum);
-       Lst_Append(list, suff);
-       suff->refCount++;
+       Lst_Append(list, SuffRef(suff));
        Lst_Append(suff->ref, list);
     } else if (listSuff->sNum != suff->sNum) {
            DEBUG4(SUFF, "inserting \"%s\" (%d) before \"%s\" (%d)\n",
                   suff->name, suff->sNum, listSuff->name, listSuff->sNum);
-       Lst_InsertBefore(list, ln, suff);
-       suff->refCount++;
+       Lst_InsertBefore(list, ln, SuffRef(suff));
        Lst_Append(suff->ref, list);
     } else {
        SUFF_DEBUG2("\"%s\" (%d) is already there\n", suff->name, suff->sNum);



Home | Main Index | Thread Index | Old Index