[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Pure strings (Re: Compilation to native)
From: |
Kenichi Handa |
Subject: |
Re: Pure strings (Re: Compilation to native) |
Date: |
Tue, 20 Apr 2004 08:39:41 +0900 (JST) |
User-agent: |
SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/21.3 (sparc-sun-solaris2.6) MULE/5.0 (SAKAKI) |
In article <address@hidden>, Stefan Monnier <address@hidden> writes:
>> Yes. Isn't it better to do copy-sequence on the fly, for
>> instance, in parse_menu_item (in keyboard.c) to avoid the
>> similar problem for the future?
> Sounds like a costly alternative, constantly allocating new strings.
What I thought was to change the slot of the string to the
copied one if the string is read-only (as the attached
code). Then it seems that the count of copying is the same
as the case that we call copy-sequence in
menu-bar-update-buffers. But, as I'm not familiar with the
code around parse_menu_item, I may be wrong.
---
Ken'ichi HANDA
address@hidden
*** keyboard.c 19 Apr 2004 08:43:56 +0900 1.770
--- keyboard.c 20 Apr 2004 08:08:53 +0900
***************
*** 7150,7155 ****
--- 7150,7160 ----
AREF (item_properties, ITEM_PROPERTY_ITEM) = item;
item_string = XCAR (item);
+ if (STRINGP (item_string) && PURE_P (item_string))
+ {
+ item_string = Fcopy_sequence (item_string);
+ XSETCAR (item, item_string);
+ }
start = item;
item = XCDR (item);
- Re: Compilation to native, (continued)
- Re: Compilation to native, Richard Stallman, 2004/04/07
- Re: Compilation to native, Juri Linkov, 2004/04/13
- Re: Compilation to native, Kenichi Handa, 2004/04/13
- Re: Compilation to native, Juri Linkov, 2004/04/13
- Re: Compilation to native, Kenichi Handa, 2004/04/13
- Pure strings (Re: Compilation to native), Juri Linkov, 2004/04/15
- Re: Pure strings (Re: Compilation to native), Richard Stallman, 2004/04/18
- Re: Pure strings (Re: Compilation to native), Kenichi Handa, 2004/04/19
- Re: Pure strings (Re: Compilation to native), Stefan Monnier, 2004/04/19
- Re: Pure strings (Re: Compilation to native),
Kenichi Handa <=
- Re: Pure strings (Re: Compilation to native), Richard Stallman, 2004/04/19
- Re: Pure strings (Re: Compilation to native), Kenichi Handa, 2004/04/19
Re: Compilation to native, Matthew Mundell, 2004/04/12
- Re: Compilation to native, Stefan Monnier, 2004/04/12
- Re: Compilation to native, Matthew Mundell, 2004/04/13
- Re: Compilation to native, Stefan Monnier, 2004/04/13
- Re: Compilation to native, Matthew Mundell, 2004/04/13
- Re: Compilation to native, Miles Bader, 2004/04/13
- Re: Compilation to native, Miles Bader, 2004/04/13
- Re: Compilation to native, Matthew Mundell, 2004/04/14