* include/ruby/intern.h (rb_{external,locale}_str_new_cstr): optimized
versions for literal strings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20224 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
99cd3c512b
commit
cc7ff9d2f9
@ -1,3 +1,8 @@
|
|||||||
|
Wed Nov 12 03:30:59 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* 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@ruby-lang.org>
|
Wed Nov 12 03:28:41 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* load.c (rb_require_safe): destroys barrier after successfully
|
* load.c (rb_require_safe): destroys barrier after successfully
|
||||||
|
@ -621,6 +621,18 @@ size_t rb_str_capacity(VALUE);
|
|||||||
rb_usascii_str_new(str, strlen(str)) : \
|
rb_usascii_str_new(str, strlen(str)) : \
|
||||||
rb_usascii_str_new_cstr(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__ ( \
|
#define rb_str_buf_new_cstr(str) __extension__ ( \
|
||||||
{ \
|
{ \
|
||||||
(__builtin_constant_p(str)) ? \
|
(__builtin_constant_p(str)) ? \
|
||||||
|
2
string.c
2
string.c
@ -28,6 +28,8 @@
|
|||||||
#undef rb_str_new_cstr
|
#undef rb_str_new_cstr
|
||||||
#undef rb_tainted_str_new_cstr
|
#undef rb_tainted_str_new_cstr
|
||||||
#undef rb_usascii_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_new2
|
||||||
#undef rb_str_new3
|
#undef rb_str_new3
|
||||||
#undef rb_str_new4
|
#undef rb_str_new4
|
||||||
|
Loading…
x
Reference in New Issue
Block a user