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): remove the inline attribute from debug...



details:   https://anonhg.NetBSD.org/src/rev/d36760934259
branches:  trunk
changeset: 939739:d36760934259
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Sep 28 22:38:32 2020 +0000

description:
make(1): remove the inline attribute from debug_printf

The code size overhead of a varargs function is much more than I had
expected.  Since GCC 5 didn't inline the function anyway and it is only
used in debug mode, there is no point keeping multiple copies of that
code around.

diffstat:

 usr.bin/make/make.c |  14 ++++++++++++--
 usr.bin/make/make.h |  12 ++----------
 2 files changed, 14 insertions(+), 12 deletions(-)

diffs (61 lines):

diff -r 54e16e14f27d -r d36760934259 usr.bin/make/make.c
--- a/usr.bin/make/make.c       Mon Sep 28 22:23:35 2020 +0000
+++ b/usr.bin/make/make.c       Mon Sep 28 22:38:32 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: make.c,v 1.153 2020/09/28 22:23:35 rillig Exp $        */
+/*     $NetBSD: make.c,v 1.154 2020/09/28 22:38:32 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -107,7 +107,7 @@
 #include    "job.h"
 
 /*     "@(#)make.c     8.1 (Berkeley) 6/6/93"  */
-MAKE_RCSID("$NetBSD: make.c,v 1.153 2020/09/28 22:23:35 rillig Exp $");
+MAKE_RCSID("$NetBSD: make.c,v 1.154 2020/09/28 22:38:32 rillig Exp $");
 
 /* Sequence # to detect recursion. */
 static unsigned int checked = 1;
@@ -125,6 +125,16 @@
 static int MakeBuildChild(void *, void *);
 static int MakeBuildParent(void *, void *);
 
+void
+debug_printf(const char *fmt, ...)
+{
+    va_list args;
+
+    va_start(args, fmt);
+    vfprintf(debug_file, fmt, args);
+    va_end(args);
+}
+
 MAKE_ATTR_DEAD static void
 make_abort(GNode *gn, int line)
 {
diff -r 54e16e14f27d -r d36760934259 usr.bin/make/make.h
--- a/usr.bin/make/make.h       Mon Sep 28 22:23:35 2020 +0000
+++ b/usr.bin/make/make.h       Mon Sep 28 22:38:32 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: make.h,v 1.150 2020/09/28 22:23:35 rillig Exp $        */
+/*     $NetBSD: make.h,v 1.151 2020/09/28 22:38:32 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -524,15 +524,7 @@
 
 #define        DEBUG(module)   (debug & CONCAT(DEBUG_,module))
 
-static inline MAKE_ATTR_UNUSED void MAKE_ATTR_PRINTFLIKE(1, 2)
-debug_printf(const char *fmt, ...)
-{
-    va_list args;
-
-    va_start(args, fmt);
-    vfprintf(debug_file, fmt, args);
-    va_end(args);
-}
+void debug_printf(const char *, ...) MAKE_ATTR_PRINTFLIKE(1, 2);
 
 #define DEBUG0(module, text) \
     if (!DEBUG(module)) (void)0; \



Home | Main Index | Thread Index | Old Index