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): save a few memory allocations in varia...
details: https://anonhg.NetBSD.org/src/rev/249b952a18a4
branches: trunk
changeset: 958048:249b952a18a4
user: rillig <rillig%NetBSD.org@localhost>
date: Mon Dec 21 00:30:13 2020 +0000
description:
make(1): save a few memory allocations in variable expressions
diffstat:
usr.bin/make/var.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diffs (54 lines):
diff -r 4cba002e35a3 -r 249b952a18a4 usr.bin/make/var.c
--- a/usr.bin/make/var.c Mon Dec 21 00:20:58 2020 +0000
+++ b/usr.bin/make/var.c Mon Dec 21 00:30:13 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: var.c,v 1.758 2020/12/21 00:20:58 rillig Exp $ */
+/* $NetBSD: var.c,v 1.759 2020/12/21 00:30:13 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -131,7 +131,7 @@
#include "metachar.h"
/* "@(#)var.c 8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.758 2020/12/21 00:20:58 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.759 2020/12/21 00:30:13 rillig Exp $");
typedef enum VarFlags {
VAR_NONE = 0,
@@ -2432,7 +2432,7 @@
if (st->eflags & VARE_WANTRES)
st->newVal = FStr_InitOwn(Cmd_Exec(cmd, &errfmt));
else
- st->newVal = FStr_InitOwn(bmake_strdup(""));
+ st->newVal = FStr_InitRefer("");
if (errfmt != NULL)
Error(errfmt, cmd); /* XXX: why still return AMR_OK? */
free(cmd);
@@ -2899,7 +2899,7 @@
if (estr[0] == '#' && estr[1] == '\0') { /* Found ":[#]" */
if (st->oneBigWord) {
- st->newVal = FStr_InitOwn(bmake_strdup("1"));
+ st->newVal = FStr_InitRefer("1");
} else {
Buffer buf;
@@ -3177,7 +3177,7 @@
}
}
free(val);
- st->newVal = FStr_InitOwn(bmake_strdup(""));
+ st->newVal = FStr_InitRefer("");
return AMR_OK;
}
@@ -3303,7 +3303,7 @@
if (errfmt != NULL)
Error(errfmt, val);
} else
- st->newVal = FStr_InitOwn(bmake_strdup(""));
+ st->newVal = FStr_InitRefer("");
*pp = p + 2;
return AMR_OK;
} else
Home |
Main Index |
Thread Index |
Old Index