ash: [MEMALLOC] Made grabstackblock an inline wrapper for stalloc
authorDenys Vlasenko <vda.linux@googlemail.com>
Wed, 26 Oct 2016 16:26:27 +0000 (18:26 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Wed, 26 Oct 2016 16:26:27 +0000 (18:26 +0200)
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@googlemail.com>
shell/ash.c

index 2c439602a7bc7b36ac0fe32d6be62942cb0f4ac0..e47c47850ebe98b9f682b663e62f9915244700c1 100644 (file)
@@ -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