From 0765acead7afe707253bd7019e6889c5ccec86dc Mon Sep 17 00:00:00 2001 From: Marc Espie Date: Sat, 17 Nov 2007 16:39:46 +0000 Subject: simplify dynamic variable handling a great deal: first remove all usage of Varq_Append by building the string directly. then replace `common' handling with specialized handling for dynamic strings (since they no longer need a buffer). Finally, identify the place where the variable value needs to be copied because it's going to be free'd or erased soon, and finally, use simple char* pointers. Shaves about 80 bytes off every gnode structure, and kills quite a few unnecessary malloc()s as well. --- usr.bin/make/arch.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'usr.bin/make/arch.c') diff --git a/usr.bin/make/arch.c b/usr.bin/make/arch.c index 70661376d8f..23f6363e6fe 100644 --- a/usr.bin/make/arch.c +++ b/usr.bin/make/arch.c @@ -1,5 +1,5 @@ /* $OpenPackages$ */ -/* $OpenBSD: arch.c,v 1.74 2007/11/10 12:51:40 espie Exp $ */ +/* $OpenBSD: arch.c,v 1.75 2007/11/17 16:39:45 espie Exp $ */ /* $NetBSD: arch.c,v 1.17 1996/11/06 17:58:59 christos Exp $ */ /* @@ -872,7 +872,7 @@ ArchTouch(const char *archive, const char *member) void Arch_Touch(GNode *gn) { - ArchTouch(Varq_Value(ARCHIVE_INDEX, gn), Varq_Value(MEMBER_INDEX, gn)); + ArchTouch(Var(ARCHIVE_INDEX, gn), Var(MEMBER_INDEX, gn)); } /*ARGSUSED*/ @@ -891,8 +891,8 @@ Arch_TouchLib(GNode *gn UNUSED) TIMESTAMP Arch_MTime(GNode *gn) { - gn->mtime = ArchMTimeMember(Varq_Value(ARCHIVE_INDEX, gn), - Varq_Value(MEMBER_INDEX, gn), true); + gn->mtime = ArchMTimeMember(Var(ARCHIVE_INDEX, gn), + Var(MEMBER_INDEX, gn), true); return gn->mtime; } @@ -940,7 +940,7 @@ Arch_MemMTime(GNode *gn) void Arch_FindLib(GNode *gn, Lst path UNUSED) { - Varq_Set(TARGET_INDEX, gn->name, gn); + Var(TARGET_INDEX, gn) = gn->name; } /*- -- cgit v1.2.3