On 29/04/2019 23:55, Harald van Dijk wrote:
On 29/04/2019 15:44, Vadim Zeitlin wrote:
On Sat, 27 Apr 2019 22:58:23 +0100 Harald van Dijk
<harald@xxxxxxxxxxx> wrote:
HvD> It wastes memory: the code should be re-worked so that output and
HvD> preverrout share the same buffer, given that there can never be
pending
HvD> output for one when the other is being written to.
I'm a bit worried about this one, it doesn't seem completely obvious
to me
that the 2 objects can't be used at the same time.
It's indeed not completely obvious, but all bits that print to output
will flush the buffer when they're done, before a next command starts
executing, before the next command requires an xtrace string to be
printed. It's usually the flushall() in evalbltin() that handles this.
I have managed to verify that using a single buffer for all streams
(output, errout and preverrout) works well and simplifies logic so that
the shell with that change is actually smaller than the one without it.
I do not know whether there would be interest in getting that in dash.
Cheers,
Harald van Dijk