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 duplicate code from bmake_strdup



details:   https://anonhg.NetBSD.org/src/rev/706214b98a25
branches:  trunk
changeset: 957709:706214b98a25
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Dec 07 22:37:18 2020 +0000

description:
make(1): remove duplicate code from bmake_strdup

Inlining is the job of the compiler, not of humans.

diffstat:

 usr.bin/make/make_malloc.c |  7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diffs (28 lines):

diff -r 39b5079c259a -r 706214b98a25 usr.bin/make/make_malloc.c
--- a/usr.bin/make/make_malloc.c        Mon Dec 07 22:27:56 2020 +0000
+++ b/usr.bin/make/make_malloc.c        Mon Dec 07 22:37:18 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: make_malloc.c,v 1.23 2020/10/05 19:27:47 rillig Exp $  */
+/*     $NetBSD: make_malloc.c,v 1.24 2020/12/07 22:37:18 rillig Exp $  */
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
 
 #include "make.h"
 
-MAKE_RCSID("$NetBSD: make_malloc.c,v 1.23 2020/10/05 19:27:47 rillig Exp $");
+MAKE_RCSID("$NetBSD: make_malloc.c,v 1.24 2020/12/07 22:37:18 rillig Exp $");
 
 #ifndef USE_EMALLOC
 
@@ -61,8 +61,7 @@
        char *p;
 
        len = strlen(str) + 1;
-       if ((p = malloc(len)) == NULL)
-               enomem();
+       p = bmake_malloc(len);
        return memcpy(p, str, len);
 }
 



Home | Main Index | Thread Index | Old Index