Module Name:    src
Committed By:   rillig
Date:           Mon Dec  7 22:37:18 UTC 2020

Modified Files:
        src/usr.bin/make: make_malloc.c

Log Message:
make(1): remove duplicate code from bmake_strdup

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


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/usr.bin/make/make_malloc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/make_malloc.c
diff -u src/usr.bin/make/make_malloc.c:1.23 src/usr.bin/make/make_malloc.c:1.24
--- src/usr.bin/make/make_malloc.c:1.23	Mon Oct  5 19:27:47 2020
+++ src/usr.bin/make/make_malloc.c	Mon Dec  7 22:37:18 2020
@@ -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 @@ bmake_strdup(const char *str)
 	char *p;
 
 	len = strlen(str) + 1;
-	if ((p = malloc(len)) == NULL)
-		enomem();
+	p = bmake_malloc(len);
 	return memcpy(p, str, len);
 }
 

Reply via email to