zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.stephenson@samsung.com>
To: Zsh Hackers' List <zsh-workers@zsh.org>
Subject: Re: VARARR in pattern code
Date: Mon, 08 Sep 2014 15:24:55 +0100	[thread overview]
Message-ID: <20140908152455.7694dd23@pwslap01u.europe.root.pri> (raw)
In-Reply-To: <20140908151037.5ec31e8a@pwslap01u.europe.root.pri>

On Mon, 08 Sep 2014 15:10:37 +0100
Peter Stephenson <p.stephenson@samsung.com> wrote:
> While looking at the problem with repeated *'s, I notice that inside the
> pattern code for closures --- *'s, #'s and ##'s --- there's a VARARR.
> 
> 		/*
> 		 * Array to record the start of characters for
> 		 * backtracking.
> 		 */
> 		VARARR(char, charstart, patinend-patinput);
> 
> If you're interested, that was added to fix a very similar problem with
> pathological backtracking involving negated matches with "~" or "^".

Hmm... I think I tell a lie.  I think this one was added for multibyte
mode --- when backtracking, the only way I know of to guarantee you're
going back a whole character is either to scan the entire string from
the start, or remember, and this does the latter.

There may be some more efficient way of backtracking through multibyte
strings known to cognoscenti.

The allocation I original thought this one was is actually a zshcalloc()
around line 2841 (post patch), so not subject to VARARR(), and as it's
only used by the exclusion code it doesn't slow down standard glob
matches.

pws


      reply	other threads:[~2014-09-08 14:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAHAq8pF=hB4sfx+Fe6nfnbJ8W7E9r9e_mHytBdu=Oy_6CWukJA@mail.gmail.com>
2014-09-08 14:10 ` Peter Stephenson
2014-09-08 14:24   ` Peter Stephenson [this message]

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=20140908152455.7694dd23@pwslap01u.europe.root.pri \
    --to=p.stephenson@samsung.com \
    --cc=zsh-workers@zsh.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.
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).