1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-19 10:53:58 +00:00

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).
This commit is contained in:
Jilles Tjoelker 2011-01-09 22:47:58 +00:00
parent 50ffd2d643
commit 33a8413363
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=217209
2 changed files with 1 additions and 11 deletions

View File

@ -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

View File

@ -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); }