ash: [EXPAND] Removed herefd hack
authorDenys Vlasenko <vda.linux@googlemail.com>
Tue, 25 Oct 2016 19:10:20 +0000 (21:10 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Tue, 25 Oct 2016 19:10:20 +0000 (21:10 +0200)
commit579ad107a69690efc17401c487b06e89d9e8a91d
tree967ef2eeb3cb03d95aff3644f2842ac99b9c9b1f
parentcaee80cd3da65670a576e610044fdc5e7c957d6d
ash: [EXPAND] Removed herefd hack

Upstream commit:

    Date: Sun, 11 Nov 2007 15:00:06 +0800
    [EXPAND] Removed herefd hack

    The herefd hack goes back more than a decade.  it limits the amount of
    memory we have to allocate when expanding here-documents by writing the
    result out from time to time.  However, it's no longer safe because the
    stack is used to place intermediate results too and there we certainly
    don't want to write them out should we be short on memory.

    In any case, with today's computers we can afford to keep the entire
    result in memory and write them out at the end.

function                                             old     new   delta
redirect                                            1268    1264      -4
ash_main                                            1485    1478      -7
subevalvar                                          1157    1132     -25
growstackstr                                          54      24     -30
argstr                                              1192    1154     -38
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/5 up/down: 0/-104)           Total: -104 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
shell/ash.c