From 0a48ef908e86d8f9c96122f9e6f0d6d0e6dacbd0 Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 30 Oct 2015 03:07:06 +0000 Subject: variable.c: rb_class_ivar_set * variable.c (rb_class_ivar_set): rename as class specific ivar setter, and st_table is no longer involved. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52380 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ class.c | 2 +- internal.h | 3 +-- variable.c | 8 ++++---- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7c4ae76b95..7ab414a107 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Fri Oct 30 12:06:59 2015 Nobuyoshi Nakada + + * variable.c (rb_class_ivar_set): rename as class specific ivar + setter, and st_table is no longer involved. + Fri Oct 30 11:36:33 2015 Eric Wong * variable.c (generic_ivar_remove): adjust type, set valp diff --git a/class.c b/class.c index 46ef7d76e9..7a9db63dcc 100644 --- a/class.c +++ b/class.c @@ -426,7 +426,7 @@ rb_singleton_class_attached(VALUE klass, VALUE obj) if (!RCLASS_IV_TBL(klass)) { RCLASS_IV_TBL(klass) = st_init_numtable(); } - rb_st_insert_id_and_value(klass, id_attached, obj); + rb_class_ivar_set(klass, id_attached, obj); } } diff --git a/internal.h b/internal.h index 790f472763..163fb65041 100644 --- a/internal.h +++ b/internal.h @@ -1317,8 +1317,7 @@ extern unsigned long ruby_scan_digits(const char *str, ssize_t len, int base, si void rb_gc_mark_global_tbl(void); void rb_mark_generic_ivar(VALUE); VALUE rb_const_missing(VALUE klass, VALUE name); - -int rb_st_insert_id_and_value(VALUE obj, ID key, VALUE value); +int rb_class_ivar_set(VALUE klass, ID vid, VALUE value); st_table *rb_st_copy(VALUE obj, struct st_table *orig_tbl); /* gc.c (export) */ diff --git a/variable.c b/variable.c index 5bb6722f79..49853b64e9 100644 --- a/variable.c +++ b/variable.c @@ -158,7 +158,7 @@ find_class_path(VALUE klass, ID preferred) if (!RCLASS_IV_TBL(klass)) { RCLASS_IV_TBL(klass) = st_init_numtable(); } - rb_st_insert_id_and_value(klass, (st_data_t)classpath, arg.path); + rb_class_ivar_set(klass, (st_data_t)classpath, arg.path); st_delete(RCLASS_IV_TBL(klass), &tmp, 0); return arg.path; @@ -1412,7 +1412,7 @@ rb_ivar_set(VALUE obj, ID id, VALUE val) case T_CLASS: case T_MODULE: if (!RCLASS_IV_TBL(obj)) RCLASS_IV_TBL(obj) = st_init_numtable(); - rb_st_insert_id_and_value(obj, (st_data_t)id, val); + rb_class_ivar_set(obj, (st_data_t)id, val); break; default: generic_ivar_set(obj, id, val); @@ -2803,7 +2803,7 @@ rb_cvar_set(VALUE klass, ID id, VALUE val) RCLASS_IV_TBL(target) = st_init_numtable(); } - rb_st_insert_id_and_value(target, (st_data_t)id, (st_data_t)val); + rb_class_ivar_set(target, (st_data_t)id, (st_data_t)val); } VALUE @@ -3032,7 +3032,7 @@ rb_iv_set(VALUE obj, const char *name, VALUE val) /* tbl = xx(obj); tbl[key] = value; */ int -rb_st_insert_id_and_value(VALUE obj, ID key, VALUE value) +rb_class_ivar_set(VALUE obj, ID key, VALUE value) { st_table *tbl = RCLASS_IV_TBL(obj); int result = st_insert(tbl, (st_data_t)key, (st_data_t)value); -- cgit v1.2.3