summaryrefslogtreecommitdiff
path: root/usr.bin/make/lst.lib/lstInit.c
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2000-06-17 14:43:41 +0000
committerMarc Espie <espie@cvs.openbsd.org>2000-06-17 14:43:41 +0000
commitd0f862960eef69fdd7801239999a637a2b2d5021 (patch)
treed044a096bd0bd61354904e3f2933b6e6e9260f0c /usr.bin/make/lst.lib/lstInit.c
parentba25a00b79070aa39d76e92f0c729f0e2a3f39a4 (diff)
This removes the few instances of Lst_New left.
- replaces Lst_Duplicate with Lst_Clone, which does not allocate storage - split Lst_Concat into Lst_Concat/Lst_ConcatDestroy Thus, all the LstValid checks are gone, since we always invoke list functions with valid pointers. Note that dynamic list allocation accounted for roughly 20% of all calls to malloc. The extraneous calls to malloc left are now mostly in parse.c, which makes some wasteful usage of temporary buffers. With those few patches, the code is sturdier, and easier to maintain. Reviewed by millert@
Diffstat (limited to 'usr.bin/make/lst.lib/lstInit.c')
-rw-r--r--usr.bin/make/lst.lib/lstInit.c20
1 files changed, 2 insertions, 18 deletions
diff --git a/usr.bin/make/lst.lib/lstInit.c b/usr.bin/make/lst.lib/lstInit.c
index 1497be9b03d..8e393363924 100644
--- a/usr.bin/make/lst.lib/lstInit.c
+++ b/usr.bin/make/lst.lib/lstInit.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lstInit.c,v 1.8 2000/06/17 14:38:22 espie Exp $ */
+/* $OpenBSD: lstInit.c,v 1.9 2000/06/17 14:43:39 espie Exp $ */
/* $NetBSD: lstInit.c,v 1.5 1996/11/06 17:59:43 christos Exp $ */
/*
@@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)lstInit.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: lstInit.c,v 1.8 2000/06/17 14:38:22 espie Exp $";
+static char rcsid[] = "$OpenBSD: lstInit.c,v 1.9 2000/06/17 14:43:39 espie Exp $";
#endif
#endif /* not lint */
@@ -54,22 +54,6 @@ static char rcsid[] = "$OpenBSD: lstInit.c,v 1.8 2000/06/17 14:38:22 espie Exp $
/*-
*-----------------------------------------------------------------------
- * Lst_New --
- * Create and initialize a new list.
- *-----------------------------------------------------------------------
- */
-Lst
-Lst_New()
-{
- register Lst nList;
-
- PAlloc(nList, Lst);
- Lst_Init(nList);
-
- return nList;
-}
-/*-
- *-----------------------------------------------------------------------
* Lst_Init --
* Initialize a new list.
*-----------------------------------------------------------------------