Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: zsh segfaults with lots of data in one variable
- X-seq: zsh-workers 26689
- From: Peter Stephenson <pws@xxxxxxx>
- To: zsh workers <zsh-workers@xxxxxxxxxx>
- Subject: Re: zsh segfaults with lots of data in one variable
- Date: Wed, 04 Mar 2009 16:32:48 +0000
- In-reply-to: <2d460de70903040709v543ee0c7ie1258bdee8177463@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20090303210729.GU4167@xxxxxxxxxxxxxxx> <20090303220347.36279ac1@pws-pc> <2d460de70903040709v543ee0c7ie1258bdee8177463@xxxxxxxxxxxxxx>
Richard Hartmann wrote:
> On Tue, Mar 3, 2009 at 23:03, Peter Stephenson
> <p.w.stephenson@xxxxxxxxxxxx> 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@xxxxxxx> Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070
Messages sorted by:
Reverse Date,
Date,
Thread,
Author