diff options
author | Jilles Tjoelker <jilles@FreeBSD.org> | 2011-01-09 22:47:58 +0000 |
---|---|---|
committer | Jilles Tjoelker <jilles@FreeBSD.org> | 2011-01-09 22:47:58 +0000 |
commit | 33a8413363fd2057d99166b6254edd6c34b0224b (patch) | |
tree | e929357aa197edb94c922e9cb54864a330f718c6 /bin | |
parent | 50ffd2d643a704b47fbddc2326ebd1787dddd115 (diff) | |
download | src-33a8413363fd2057d99166b6254edd6c34b0224b.tar.gz src-33a8413363fd2057d99166b6254edd6c34b0224b.zip |
sh: Follow-up to r216743, grabstackblock() can be replaced with stalloc().
grabstackblock() was used only once (but it is a very often executed piece
of code).
Notes
Notes:
svn path=/head/; revision=217209
Diffstat (limited to 'bin')
-rw-r--r-- | bin/sh/memalloc.c | 10 | ||||
-rw-r--r-- | bin/sh/memalloc.h | 2 |
2 files changed, 1 insertions, 11 deletions
diff --git a/bin/sh/memalloc.c b/bin/sh/memalloc.c index 3ee104c4cc4e..bc567d08450e 100644 --- a/bin/sh/memalloc.c +++ b/bin/sh/memalloc.c @@ -277,16 +277,6 @@ growstackblock(int min) -void -grabstackblock(int len) -{ - len = ALIGN(len); - stacknxt += len; - stacknleft -= len; -} - - - /* * The following routines are somewhat easier to use that the above. * The user declares a variable of type STACKSTR, which may be declared diff --git a/bin/sh/memalloc.h b/bin/sh/memalloc.h index f3e8829eed4f..425004ed3f72 100644 --- a/bin/sh/memalloc.h +++ b/bin/sh/memalloc.h @@ -55,7 +55,6 @@ pointer stalloc(int); void stunalloc(pointer); void setstackmark(struct stackmark *); void popstackmark(struct stackmark *); -void grabstackblock(int); char *growstackstr(void); char *makestrspace(int, char *); char *stputbin(const char *data, int len, char *p); @@ -65,6 +64,7 @@ char *stputs(const char *data, char *p); #define stackblock() stacknxt #define stackblocksize() stacknleft +#define grabstackblock(n) stalloc(n) #define STARTSTACKSTR(p) p = stackblock() #define STPUTC(c, p) do { if (p == sstrend) p = growstackstr(); *p++ = (c); } while(0) #define CHECKSTRSPACE(n, p) { if (sstrend - p < n) p = makestrspace(n, p); } |