ruby-changes:29689
From: nobu <ko1@a...>
Date: Tue, 2 Jul 2013 17:22:44 +0900 (JST)
Subject: [ruby-changes:29689] nobu:r41741 (trunk): internal.h: use built-in encoding indexes
nobu 2013-07-02 17:22:30 +0900 (Tue, 02 Jul 2013) New Revision: 41741 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=41741 Log: internal.h: use built-in encoding indexes * internal.h (rb_{ascii8bit,utf8,usascii}_encindex): use built-in encoding indexes for optimization. Modified files: trunk/ChangeLog trunk/encoding.c trunk/internal.h trunk/thread.c Index: encoding.c =================================================================== --- encoding.c (revision 41740) +++ encoding.c (revision 41741) @@ -24,6 +24,10 @@ https://github.com/ruby/ruby/blob/trunk/encoding.c#L24 #endif #include "ruby/util.h" +#undef rb_ascii8bit_encindex +#undef rb_utf8_encindex +#undef rb_usascii_encindex + #if defined __GNUC__ && __GNUC__ >= 4 #pragma GCC visibility push(default) int rb_enc_register(const char *name, rb_encoding *encoding); Index: ChangeLog =================================================================== --- ChangeLog (revision 41740) +++ ChangeLog (revision 41741) @@ -1,4 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 -Tue Jul 2 17:22:21 2013 Nobuyoshi Nakada <nobu@r...> +Tue Jul 2 17:22:25 2013 Nobuyoshi Nakada <nobu@r...> + + * internal.h (rb_{ascii8bit,utf8,usascii}_encindex): use built-in + encoding indexes for optimization. * encoding.c (enc_inspect, rb_locale_encindex), (enc_set_filesystem_encoding, rb_filesystem_encindex): use built-in Index: thread.c =================================================================== --- thread.c (revision 41740) +++ thread.c (revision 41741) @@ -59,10 +59,10 @@ https://github.com/ruby/ruby/blob/trunk/thread.c#L59 #include "eval_intern.h" #include "gc.h" -#include "internal.h" #include "timev.h" #include "ruby/io.h" #include "ruby/thread.h" +#include "internal.h" #ifndef USE_NATIVE_THREAD_PRIORITY #define USE_NATIVE_THREAD_PRIORITY 0 Index: internal.h =================================================================== --- internal.h (revision 41740) +++ internal.h (revision 41741) @@ -209,6 +209,9 @@ enum ruby_preserved_encindex { https://github.com/ruby/ruby/blob/trunk/internal.h#L209 ENCINDEX_BUILTIN_MAX }; #endif +#define rb_ascii8bit_encindex() ENCINDEX_ASCII +#define rb_utf8_encindex() ENCINDEX_UTF_8 +#define rb_usascii_encindex() ENCINDEX_US_ASCII ID rb_id_encoding(void); void rb_gc_mark_encodings(void); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/