ruby-changes:8726
From: yugui <ko1@a...>
Date: Wed, 19 Nov 2008 01:47:23 +0900 (JST)
Subject: [ruby-changes:8726] Ruby:r20261 (ruby_1_9_1): merges r20224 from trunk into ruby_1_9_1
yugui 2008-11-19 01:46:47 +0900 (Wed, 19 Nov 2008) New Revision: 20261 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=20261 Log: merges r20224 from trunk into ruby_1_9_1 * include/ruby/intern.h (rb_{external,locale}_str_new_cstr): optimized versions for literal strings. Modified files: branches/ruby_1_9_1/ChangeLog branches/ruby_1_9_1/include/ruby/intern.h branches/ruby_1_9_1/string.c Index: ruby_1_9_1/include/ruby/intern.h =================================================================== --- ruby_1_9_1/include/ruby/intern.h (revision 20260) +++ ruby_1_9_1/include/ruby/intern.h (revision 20261) @@ -621,6 +621,18 @@ rb_usascii_str_new(str, strlen(str)) : \ rb_usascii_str_new_cstr(str); \ }) +#define rb_external_str_new_cstr(str) __extension__ ( \ +{ \ + (__builtin_constant_p(str)) ? \ + rb_external_str_new(str, strlen(str)) : \ + rb_external_str_new_cstr(str); \ +}) +#define rb_locale_str_new_cstr(str) __extension__ ( \ +{ \ + (__builtin_constant_p(str)) ? \ + rb_locale_str_new(str, strlen(str)) : \ + rb_locale_str_new_cstr(str); \ +}) #define rb_str_buf_new_cstr(str) __extension__ ( \ { \ (__builtin_constant_p(str)) ? \ Index: ruby_1_9_1/ChangeLog =================================================================== --- ruby_1_9_1/ChangeLog (revision 20260) +++ ruby_1_9_1/ChangeLog (revision 20261) @@ -1,3 +1,8 @@ +Wed Nov 12 03:30:59 2008 Nobuyoshi Nakada <nobu@r...> + + * include/ruby/intern.h (rb_{external,locale}_str_new_cstr): optimized + versions for literal strings. + Wed Nov 12 03:28:41 2008 Nobuyoshi Nakada <nobu@r...> * load.c (rb_require_safe): destroys barrier after successfully Index: ruby_1_9_1/string.c =================================================================== --- ruby_1_9_1/string.c (revision 20260) +++ ruby_1_9_1/string.c (revision 20261) @@ -28,6 +28,8 @@ #undef rb_str_new_cstr #undef rb_tainted_str_new_cstr #undef rb_usascii_str_new_cstr +#undef rb_external_str_new_cstr +#undef rb_locale_str_new_cstr #undef rb_str_new2 #undef rb_str_new3 #undef rb_str_new4 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/