zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@csr.com>
To: zsh workers <zsh-workers@sunsite.dk>
Subject: Re: zsh segfaults with lots of data in one variable
Date: Wed, 04 Mar 2009 16:32:48 +0000	[thread overview]
Message-ID: <200903041632.n24GWmLk008197@news01.csr.com> (raw)
In-Reply-To: <2d460de70903040709v543ee0c7ie1258bdee8177463@mail.gmail.com>

Richard Hartmann wrote:
> On Tue, Mar 3, 2009 at 23:03, Peter Stephenson
> <p.w.stephenson@ntlworld.com> wrote:
> 
> > However, in our case it's easy to fix just using ordindary malloc memory
> > for saving $_. =C2=A0It would be much more efficient to mark underscore as
> > "push old value to stack on write", or something similar, but if I try
> > that at ten o'clock in the evening I'll get it wrong.
> 
> Do you want to revisit this at a later time? If yes, I will mark this as bug
> and put it into SF's bug tracker after some time (usually you are simply too
> fast for me to actually put anything in there ;)

On the whole, I suspect it's not worth it.  The shell is optimised for
moving around strings of a few dozen bytes or so.  To do it better, we'd
need some sort of a stack; that means an additional allocation.  That's
going to add to the complexity in the vast majority of cases just to
improve the occasional case where $_ is some huge string on entry to a
function.   I don't regard this as a bug, anyway, so I think we can
ignore it for now.

Ta.

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


  reply	other threads:[~2009-03-04 16:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-03 21:07 Frank Terbeck
2009-03-03 22:03 ` Peter Stephenson
2009-03-04 15:09   ` Richard Hartmann
2009-03-04 16:32     ` Peter Stephenson [this message]
2009-03-03 22:09 ` Peter Stephenson

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=200903041632.n24GWmLk008197@news01.csr.com \
    --to=pws@csr.com \
    --cc=zsh-workers@sunsite.dk \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

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 NNTP newsgroup(s).