summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--src/memalloc.c8
-rw-r--r--src/memalloc.h6
3 files changed, 9 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index 940e4b0..383332c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2007-10-05  Herbert Xu <herbert@gondor.apana.org.au>
+
+	* Made grabstackblock an inline wrapper for stalloc.
+
 2007-10-04  Herbert Xu <herbert@gondor.apana.org.au>
 
 	* Fix parsing of ${##1}.
diff --git a/src/memalloc.c b/src/memalloc.c
index 358e6ec..c8147d3 100644
--- a/src/memalloc.c
+++ b/src/memalloc.c
@@ -254,14 +254,6 @@ growstackblock(void)
 	}
 }
 
-void
-grabstackblock(size_t len)
-{
-	len = SHELL_ALIGN(len);
-	stacknxt += len;
-	stacknleft -= len;
-}
-
 /*
  * The following routines are somewhat easier to use than the above.
  * The user declares a variable of type STACKSTR, which may be declared
diff --git a/src/memalloc.h b/src/memalloc.h
index 8a41e64..282dbb0 100644
--- a/src/memalloc.h
+++ b/src/memalloc.h
@@ -57,13 +57,17 @@ void stunalloc(pointer);
 void setstackmark(struct stackmark *);
 void popstackmark(struct stackmark *);
 void growstackblock(void);
-void grabstackblock(size_t);
 void *growstackstr(void);
 char *makestrspace(size_t, char *);
 char *stnputs(const char *, size_t, char *);
 char *stputs(const char *, char *);
 
 
+static inline void grabstackblock(size_t len)
+{
+	stalloc(len);
+}
+
 static inline char *_STPUTC(int c, char *p) {
 	if (p == sstrend)
 		p = growstackstr();