summaryrefslogtreecommitdiffstats
path: root/variable.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-09 09:25:32 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-09 09:25:32 +0000
commita37463ef14409c81422b3c3d6c35a0dbd21f51b7 (patch)
tree294dcb47e83e5480b1fa992aba8a4b4025c8a626 /variable.c
parent32a51c5c95dde9e78161cccc9e75303a5523540b (diff)
downloadruby-a37463ef14409c81422b3c3d6c35a0dbd21f51b7.tar.gz
ruby-a37463ef14409c81422b3c3d6c35a0dbd21f51b7.tar.xz
ruby-a37463ef14409c81422b3c3d6c35a0dbd21f51b7.zip
* include/ruby/ruby.h (CONST_ID): constant ID cache for non-gcc.
* *.c: no cache in init functions. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'variable.c')
-rw-r--r--variable.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/variable.c b/variable.c
index 14cac1814..3185d8a3c 100644
--- a/variable.c
+++ b/variable.c
@@ -26,9 +26,9 @@ Init_var_tables(void)
{
rb_global_tbl = st_init_numtable();
rb_class_tbl = st_init_numtable();
- autoload = rb_intern("__autoload__");
- classpath = rb_intern("__classpath__");
- tmp_classpath = rb_intern("__tmp_classpath__");
+ CONST_ID(autoload, "__autoload__");
+ CONST_ID(classpath, "__classpath__");
+ CONST_ID(tmp_classpath, "__tmp_classpath__");
}
struct fc_result {
@@ -142,7 +142,9 @@ classname(VALUE klass)
if (!klass) klass = rb_cObject;
if (RCLASS_IV_TBL(klass)) {
if (!st_lookup(RCLASS_IV_TBL(klass), classpath, &path)) {
- ID classid = rb_intern("__classid__");
+ ID classid;
+
+ CONST_ID(classid, "__classid__");
if (!st_lookup(RCLASS_IV_TBL(klass), classid, &path)) {
return find_class_path(klass);