From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kenichi Handa Newsgroups: gmane.emacs.devel Subject: Re: Potential GC-related problems in compose_chars_in_text Date: Thu, 15 Sep 2005 13:21:21 +0900 Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya") Content-Type: text/plain; charset=US-ASCII X-Trace: sea.gmane.org 1126759372 470 80.91.229.2 (15 Sep 2005 04:42:52 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 15 Sep 2005 04:42:52 +0000 (UTC) Cc: storm@cua.dk, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 15 06:42:43 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EFlY9-0002z0-2O for ged-emacs-devel@m.gmane.org; Thu, 15 Sep 2005 06:40:41 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EFlY8-0000Fh-85 for ged-emacs-devel@m.gmane.org; Thu, 15 Sep 2005 00:40:40 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EFlU5-0006pL-RU for emacs-devel@gnu.org; Thu, 15 Sep 2005 00:36:30 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EFlTx-0006ks-P2 for emacs-devel@gnu.org; Thu, 15 Sep 2005 00:36:23 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EFlTx-0006YG-0d for emacs-devel@gnu.org; Thu, 15 Sep 2005 00:36:21 -0400 Original-Received: from [192.47.44.130] (helo=tsukuba.m17n.org) by monty-python.gnu.org with esmtp (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.34) id 1EFlKd-0005pQ-GL; Thu, 15 Sep 2005 00:26:43 -0400 Original-Received: from nfs.m17n.org (nfs.m17n.org [192.47.44.7]) by tsukuba.m17n.org (8.13.4/8.13.4/Debian-3) with ESMTP id j8F4LN5r023578; Thu, 15 Sep 2005 13:21:23 +0900 Original-Received: from etlken (etlken.m17n.org [192.47.44.125]) by nfs.m17n.org (8.13.4/8.13.4/Debian-3) with ESMTP id j8F4LMO9011854; Thu, 15 Sep 2005 13:21:22 +0900 Original-Received: from handa by etlken with local (Exim 3.36 #1 (Debian)) id 1EFlFR-0001Bf-00; Thu, 15 Sep 2005 13:21:21 +0900 Original-To: rms@gnu.org In-reply-to: (rms@gnu.org) 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) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:42949 Archived-At: In article , "Richard M. Stallman" 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