emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Potential GC-related problems in compose_chars_in_text


From: Kenichi Handa
Subject: Re: Potential GC-related problems in compose_chars_in_text
Date: Thu, 15 Sep 2005 13:21:21 +0900
User-agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/22.0.50 (i686-pc-linux-gnu) MULE/5.0 (SAKAKI)

In article <address@hidden>, "Richard M. Stallman" <address@hidden> 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
address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]