comparison src/syntax.h @ 5902:2dc8711af537

Make get_char_table in loop bodies more tolerable without optimization. 2015-05-08 Aidan Kehoe <kehoea@parhasard.net> * chartab.h (get_char_table): * chartab.h (get_char_table_mirrors_ok): New. Provide get_char_table_mirrors_ok, which differs from get_char_table only if ERROR_CHECK_TYPES is defined. Implement it, and get_char_table, using a macro wrapper of get_char_table_1, so that on builds without optimization each get_char_table no longer requires two C function calls. * chartab.c (updating_mirror_get_range_char_table): Use get_char_table_mirrors_ok. * syntax.h: Ditto.
author Aidan Kehoe <kehoea@parhasard.net>
date Fri, 08 May 2015 12:47:13 +0100
parents 56144c8593a8
children
comparison
equal deleted inserted replaced
5901:a485caa1131d 5902:2dc8711af537
90 SYNTAX_CODE (Lisp_Object table, Ichar c) 90 SYNTAX_CODE (Lisp_Object table, Ichar c)
91 ) 91 )
92 { 92 {
93 type_checking_assert (XCHAR_TABLE (table)->mirror_table_p); 93 type_checking_assert (XCHAR_TABLE (table)->mirror_table_p);
94 update_mirror_syntax_if_dirty (table); 94 update_mirror_syntax_if_dirty (table);
95 return XFIXNUM (get_char_table_1 (c, table)); 95 return XFIXNUM (get_char_table_mirrors_ok (c, table));
96 } 96 }
97 97
98 #ifdef NOT_WORTH_THE_EFFORT 98 #ifdef NOT_WORTH_THE_EFFORT
99 99
100 /* Same but skip the dirty check. */ 100 /* Same but skip the dirty check. */
103 int 103 int
104 SYNTAX_CODE_1 (Lisp_Object table, Ichar c) 104 SYNTAX_CODE_1 (Lisp_Object table, Ichar c)
105 ) 105 )
106 { 106 {
107 type_checking_assert (XCHAR_TABLE (table)->mirror_table_p); 107 type_checking_assert (XCHAR_TABLE (table)->mirror_table_p);
108 return (enum syntaxcode) XFIXNUM (get_char_table_1 (c, table)); 108 return (enum syntaxcode) XFIXNUM (get_char_table_mirrors_ok (c, table));
109 } 109 }
110 110
111 #endif /* NOT_WORTH_THE_EFFORT */ 111 #endif /* NOT_WORTH_THE_EFFORT */
112 112
113 #define SYNTAX_FROM_CODE(code) ((enum syntaxcode) ((code) & 0177)) 113 #define SYNTAX_FROM_CODE(code) ((enum syntaxcode) ((code) & 0177))