ruby-changes:40299
From: nobu <ko1@a...>
Date: Fri, 30 Oct 2015 12:07:31 +0900 (JST)
Subject: [ruby-changes:40299] nobu:r52380 (trunk): variable.c: rb_class_ivar_set
nobu 2015-10-30 12:07:06 +0900 (Fri, 30 Oct 2015) New Revision: 52380 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=52380 Log: 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. Modified files: trunk/ChangeLog trunk/class.c trunk/internal.h trunk/variable.c Index: ChangeLog =================================================================== --- ChangeLog (revision 52379) +++ ChangeLog (revision 52380) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Fri Oct 30 12:06:59 2015 Nobuyoshi Nakada <nobu@r...> + + * 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 <e@8...> * variable.c (generic_ivar_remove): adjust type, set valp Index: variable.c =================================================================== --- variable.c (revision 52379) +++ variable.c (revision 52380) @@ -158,7 +158,7 @@ find_class_path(VALUE klass, ID preferre https://github.com/ruby/ruby/blob/trunk/variable.c#L158 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) https://github.com/ruby/ruby/blob/trunk/variable.c#L1412 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 va https://github.com/ruby/ruby/blob/trunk/variable.c#L2803 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, V https://github.com/ruby/ruby/blob/trunk/variable.c#L3032 /* 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); Index: class.c =================================================================== --- class.c (revision 52379) +++ class.c (revision 52380) @@ -426,7 +426,7 @@ rb_singleton_class_attached(VALUE klass, https://github.com/ruby/ruby/blob/trunk/class.c#L426 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); } } Index: internal.h =================================================================== --- internal.h (revision 52379) +++ internal.h (revision 52380) @@ -1317,8 +1317,7 @@ extern unsigned long ruby_scan_digits(co https://github.com/ruby/ruby/blob/trunk/internal.h#L1317 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) */ -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/