diff options
author | jilles <jilles@FreeBSD.org> | 2011-01-09 22:47:58 +0000 |
---|---|---|
committer | jilles <jilles@FreeBSD.org> | 2011-01-09 22:47:58 +0000 |
commit | ebbca2a885e113d724fb0d1239b047d0f8a6623d (patch) | |
tree | e929357aa197edb94c922e9cb54864a330f718c6 | |
parent | 4813d862787d48502e1389794adc933b8ab4cbda (diff) | |
download | FreeBSD-src-ebbca2a885e113d724fb0d1239b047d0f8a6623d.zip FreeBSD-src-ebbca2a885e113d724fb0d1239b047d0f8a6623d.tar.gz |
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).
-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 3ee104c..bc567d0 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 f3e8829..425004e 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); } |