diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-09 09:25:32 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-09 09:25:32 +0000 |
commit | 5a647a3f5fd011f8558c7f9e90cd65e70e73eb40 (patch) | |
tree | 294dcb47e83e5480b1fa992aba8a4b4025c8a626 /class.c | |
parent | 250dd0702111d5c2086f007b1b31ecc1e36ade40 (diff) | |
download | ruby-5a647a3f5fd011f8558c7f9e90cd65e70e73eb40.tar.gz |
* include/ruby/ruby.h (CONST_ID): constant ID cache for non-gcc.
* *.c: no cache in init functions.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'class.c')
-rw-r--r-- | class.c | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -102,9 +102,9 @@ rb_mod_init_copy(VALUE clone, VALUE orig) ID id; RCLASS_IV_TBL(clone) = st_copy(RCLASS_IV_TBL(orig)); - id = rb_intern("__classpath__"); + CONST_ID(id, "__classpath__"); st_delete(RCLASS_IV_TBL(clone), (st_data_t*)&id, 0); - id = rb_intern("__classid__"); + CONST_ID(id, "__classid__"); st_delete(RCLASS_IV_TBL(clone), (st_data_t*)&id, 0); } if (RCLASS_M_TBL(orig)) { @@ -169,10 +169,12 @@ void rb_singleton_class_attached(VALUE klass, VALUE obj) { if (FL_TEST(klass, FL_SINGLETON)) { + ID attached; if (!RCLASS_IV_TBL(klass)) { RCLASS_IV_TBL(klass) = st_init_numtable(); } - st_insert(RCLASS_IV_TBL(klass), rb_intern("__attached__"), obj); + CONST_ID(attached, "__attached__"); + st_insert(RCLASS_IV_TBL(klass), attached, obj); } } @@ -214,8 +216,10 @@ rb_define_class_id(ID id, VALUE super) VALUE rb_class_inherited(VALUE super, VALUE klass) { + ID inherited; if (!super) super = rb_cObject; - return rb_funcall(super, rb_intern("inherited"), 1, klass); + CONST_ID(inherited, "inherited"); + return rb_funcall(super, inherited, 1, klass); } VALUE |