unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Michal Nazarewicz <mina86@mina86.com>
Cc: 24378@debbugs.gnu.org
Subject: bug#24378: [PATCH 1/6] Don’t use FETCH_MULTIBYTE_CHAR when advancing index
Date: Tue, 06 Sep 2016 18:27:31 +0300	[thread overview]
Message-ID: <83eg4xaw0s.fsf@gnu.org> (raw)
In-Reply-To: <xa1t1t0xgir9.fsf@mina86.com> (message from Michal Nazarewicz on Tue, 06 Sep 2016 17:17:30 +0200)

> From: Michal Nazarewicz <mina86@mina86.com>
> Cc: 24378@debbugs.gnu.org
> Date: Tue, 06 Sep 2016 17:17:30 +0200
> 
> On Tue, Sep 06 2016, Eli Zaretskii wrote:
> >> From: Michal Nazarewicz <mina86@mina86.com>
> >> Date: Tue,  6 Sep 2016 15:31:29 +0200
> >> 
> >> * src/casefiddle.c (casify_region): use STRING_CHAR_AND_LENGTH as a safe
> >> alternative to FETCH_MULTIBYTE_CHAR which is documented in src/buffer.h
> >> as unsafe when used for advancing index.
> >
> > AFAIK, that comment is stale and no longer correct.  I don't think
> > there's a reason to make this change anymore, since STRING_CHAR no
> > longer unifies characters.
> 
> I’ll drop the patch in favour of updating the comment in
> FETCH_MULTIBYTE_CHAR then.

Thanks.  While you are at that, please also update a similar comment
for STRING_CHAR as well.

> /me wonders if STRING_CHAR_AND_LENGTH must be faster than
> FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES.

It might or might not be faster (measurements are welcome), but
FETCH_MULTIBYTE_CHAR is safer when the code could GC, because it uses
a byte position, not a C pointer to buffer text.





  reply	other threads:[~2016-09-06 15:27 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-06 13:28 bug#24378: [PATCH 0/6] Small fixes and improvements Michal Nazarewicz
2016-09-06 13:31 ` bug#24378: [PATCH 1/6] Don’t use FETCH_MULTIBYTE_CHAR when advancing index Michal Nazarewicz
2016-09-06 13:31   ` bug#24378: [PATCH 2/6] Remove inaccurate comment in regex.c Michal Nazarewicz
2016-09-06 13:31   ` bug#24378: [PATCH 3/6] Replace decimalnump with alphanumericp Michal Nazarewicz
2016-09-06 13:31   ` bug#24378: [PATCH 4/6] Remove dead loop iterations in regex.c Michal Nazarewicz
2016-09-06 13:31   ` bug#24378: [PATCH 5/6] Don’t allocate char-table’s extra slots in regexp-out-charset Michal Nazarewicz
2016-09-06 13:31   ` bug#24378: [PATCH 6/6] Factor out character category lookup to separate function Michal Nazarewicz
2016-09-06 14:54     ` Eli Zaretskii
2016-09-06 15:11       ` Michal Nazarewicz
2016-09-06 15:21         ` Eli Zaretskii
2016-09-06 15:34           ` Eli Zaretskii
2016-09-06 14:43   ` bug#24378: [PATCH 1/6] Don’t use FETCH_MULTIBYTE_CHAR when advancing index Eli Zaretskii
2016-09-06 15:17     ` Michal Nazarewicz
2016-09-06 15:27       ` Eli Zaretskii [this message]
2016-09-06 15:24     ` bug#24378: [PATCH] Remove obsolete comment from FETCH_MULTIBYTE_CHAR documentation Michal Nazarewicz
2016-09-09 16:34 ` bug#24378: [PATCH 0/6] Small fixes and improvements Michal Nazarewicz

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=83eg4xaw0s.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=24378@debbugs.gnu.org \
    --cc=mina86@mina86.com \
    /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.savannah.gnu.org/cgit/emacs.git

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).