Dash Archive mirror
 help / color / mirror / Atom feed
From: Harald van Dijk <harald@gigawatt.nl>
To: Vadim Zeitlin <vz-dash@zeitlins.org>, dash@vger.kernel.org
Subject: Re: Improving xtrace output from subshells
Date: Thu, 28 May 2020 12:57:27 +0100	[thread overview]
Message-ID: <d068031c-7ff4-22bd-4951-eeeaea278386@gigawatt.nl> (raw)
In-Reply-To: <e9cdb884-89d6-9b9d-3cb8-38b9b862aa9d@gigawatt.nl>

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@gigawatt.nl> 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

           reply	other threads:[~2020-05-28 11:57 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <e9cdb884-89d6-9b9d-3cb8-38b9b862aa9d@gigawatt.nl>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d068031c-7ff4-22bd-4951-eeeaea278386@gigawatt.nl \
    --to=harald@gigawatt.nl \
    --cc=dash@vger.kernel.org \
    --cc=vz-dash@zeitlins.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).