summaryrefslogtreecommitdiff
path: root/include/ruby
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-02-13 11:52:46 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-02-13 11:52:46 +0000
commit8f842d71e98d7da744c4518afbdd49fe06b6a49a (patch)
tree1c259eaf8a0bcdb985f537369e0ba1a03e033f6f /include/ruby
parentf09eb27660e3fafe1aaa45c41b064cee010f4c88 (diff)
* include/ruby/ruby.h (RObject): add iv_index_tbl for shortcut of
RCLASS_IV_INDEX_TBL(rb_obj_class(obj)). (ROBJECT_IV_INDEX_TBL): defined. * object.c (init_copy): initialize iv_index_tbl in struct RObject. * variable.c (ivar_get): use ROBJECT_IV_INDEX_TBL. (rb_ivar_defined): ditto. (obj_ivar_each): ditto. (rb_obj_remove_instance_variable): ditto. (rb_ivar_set): update iv_index_tbl in struct RObject. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15458 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include/ruby')
-rw-r--r--include/ruby/ruby.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h
index ecc9bfd923..2ba47ab9f5 100644
--- a/include/ruby/ruby.h
+++ b/include/ruby/ruby.h
@@ -398,6 +398,7 @@ struct RObject {
struct {
long len;
VALUE *ptr;
+ struct st_table *iv_index_tbl; /* shortcut for RCLASS_IV_INDEX_TBL(rb_obj_class(obj)) */
} heap;
VALUE ary[ROBJECT_EMBED_LEN_MAX];
} as;
@@ -411,6 +412,10 @@ struct RObject {
((RBASIC(o)->flags & ROBJECT_EMBED) ? \
ROBJECT(o)->as.ary : \
ROBJECT(o)->as.heap.ptr)
+#define ROBJECT_IV_INDEX_TBL(o) \
+ ((RBASIC(o)->flags & ROBJECT_EMBED) ? \
+ RCLASS_IV_INDEX_TBL(rb_obj_class(o)) : \
+ ROBJECT(o)->as.heap.iv_index_tbl)
struct RValues {
struct RBasic basic;