unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Kenichi Handa <handa@m17n.org>
Cc: storm@cua.dk, emacs-devel@gnu.org
Subject: Re: Potential GC-related problems in compose_chars_in_text
Date: Thu, 15 Sep 2005 13:21:21 +0900	[thread overview]
Message-ID: <E1EFlFR-0001Bf-00@etlken> (raw)
In-Reply-To: <E1EFjgX-0000gd-7I@fencepost.gnu.org> (rms@gnu.org)

In article <E1EFjgX-0000gd-7I@fencepost.gnu.org>, "Richard M. Stallman" <rms@gnu.org> writes:

>>  I think that the cleanest thing to do, in loops that don't need to be
>>  as fast as possible, is avoid saving addresses of string data at all.

>     I agree.  But, I think display_mode_element is the place
>     that have to be as fast as possible.

> I would think that it doesn't take up very much of Emacs cpu time,
> and that a small slowdown there would be insignificant.  That function
> calls subroutines that do a lot of work.

> Looking at the new code, I think it is correct.  It is correct because
> the code consists of many alternatives, and each one does only a
> single nontrivial thing and then gets to the end, where lisp_string
> and this are updated.  But it seems a bit fragile to me.
> What if some branch is later changed to do two things that could
> relocate?  Then it would have a bug again.

> So I think I will still put in the change I made.

I agree that your change is cleaner, and if the performance
won't be harmed that much, it is better to use your change
except for this kind of part:

! 	    while ((c = SREF (elt, offset++)) != '\0' && c != '%')

Isn't it better to avoid using something like "offset++" as
an argument of a macro even if we know that it's currently
safe.

---
Kenichi Handa
handa@m17n.org

  reply	other threads:[~2005-09-15  4:21 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-12  0:58 potential bug in display_mode_element? Kenichi Handa
2005-09-12  8:04 ` Kim F. Storm
2005-09-12 11:54   ` Kenichi Handa
2005-09-12 12:41 ` Potential GC-related problems in compose_chars_in_text Kim F. Storm
2005-09-13  1:08   ` Kenichi Handa
2005-09-13 15:54   ` Richard M. Stallman
2005-09-14  7:29     ` Kenichi Handa
2005-09-15  2:41       ` Richard M. Stallman
2005-09-15  4:21         ` Kenichi Handa [this message]
2005-09-16  1:01           ` Richard M. Stallman
2005-09-16 15:39             ` Stefan Monnier
2005-09-17 13:39               ` Richard M. Stallman
2005-09-19 13:43                 ` Stefan Monnier
2005-09-12 15:34 ` potential bug in display_mode_element? Richard M. Stallman

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=E1EFlFR-0001Bf-00@etlken \
    --to=handa@m17n.org \
    --cc=emacs-devel@gnu.org \
    --cc=storm@cua.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.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).