aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-30 03:07:06 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-30 03:07:06 +0000
commit0a48ef908e86d8f9c96122f9e6f0d6d0e6dacbd0 (patch)
treeb64007ed694704812e775863ea806611dfeb94cf
parentf46cee77001814393f4e5e2f3ce18f2fad1f94b1 (diff)
downloadruby-0a48ef908e86d8f9c96122f9e6f0d6d0e6dacbd0.tar.gz
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
-rw-r--r--ChangeLog5
-rw-r--r--class.c2
-rw-r--r--internal.h3
-rw-r--r--variable.c8
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 <nobu@ruby-lang.org>
+
+ * 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@80x24.org>
* 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);