[git commit] ash: [MEMALLOC] Made grabstackblock an inline wrapper for stalloc

Denys Vlasenko vda.linux at googlemail.com
Wed Oct 26 16:26:27 UTC 2016


commit: https://git.busybox.net/busybox/commit/?id=a318bba199a08d65c6fb804e26d0993068a4ba16
branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master

Upstream patch:

    Date: Fri, 5 Oct 2007 23:26:45 +0800
    [MEMALLOC] Made grabstackblock an inline wrapper for stalloc

    The function grabstackblock is identical in semantics to stalloc within its
    input constraints.

function                                             old     new   delta
dotcmd                                               319     321      +2
grabstackblock                                        19       5     -14

Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 shell/ash.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/shell/ash.c b/shell/ash.c
index 2c43960..e47c478 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -1491,12 +1491,10 @@ sstrdup(const char *p)
 	return memcpy(stalloc(len), p, len);
 }
 
-static void
+static inline void
 grabstackblock(size_t len)
 {
-	len = SHELL_ALIGN(len);
-	g_stacknxt += len;
-	g_stacknleft -= len;
+	stalloc(len);
 }
 
 static void


More information about the busybox-cvs mailing list