summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog12
-rw-r--r--array.c2
-rw-r--r--process.c12
-rw-r--r--vm.c4
4 files changed, 22 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 57b11a164d..431718daca 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+Sun Dec 8 09:40:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
+
+ * array.c (rb_ary_or): use RHASH_TBL_RAW instead of RHASH_TBL
+
+ * process.c (rb_execarg_fixup): use RHASH_TBL_RAW and insert write
+ barriers where appropriate
+
+ * vm.c (kwmerge_i): use RHASH_TBL_RAW
+
+ * vm.c (HASH_ASET): use rb_hash_aset instead of calling directly into
+ st_insert
+
Sat Dec 7 11:15:52 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
* hash.c (rb_hash_reject): copy unrejected elements only to new hash,
diff --git a/array.c b/array.c
index 9668f17797..bc0cfa82b9 100644
--- a/array.c
+++ b/array.c
@@ -4058,7 +4058,7 @@ rb_ary_or(VALUE ary1, VALUE ary2)
for (i=0; i<RARRAY_LEN(ary2); i++) {
VALUE elt = RARRAY_AREF(ary2, i);
- if (!st_update(RHASH_TBL(hash), (st_data_t)elt, ary_hash_orset, (st_data_t)elt)) {
+ if (!st_update(RHASH_TBL_RAW(hash), (st_data_t)elt, ary_hash_orset, (st_data_t)elt)) {
OBJ_WRITTEN(hash, Qundef, elt);
}
}
diff --git a/process.c b/process.c
index 5b328b36d9..b40cc25a90 100644
--- a/process.c
+++ b/process.c
@@ -2316,24 +2316,26 @@ rb_execarg_fixup(VALUE execarg_obj)
}
hide_obj(envtbl);
if (envopts != Qfalse) {
- st_table *stenv = RHASH_TBL(envtbl);
+ st_table *stenv = RHASH_TBL_RAW(envtbl);
long i;
for (i = 0; i < RARRAY_LEN(envopts); i++) {
VALUE pair = RARRAY_AREF(envopts, i);
VALUE key = RARRAY_AREF(pair, 0);
VALUE val = RARRAY_AREF(pair, 1);
if (NIL_P(val)) {
- st_data_t stkey = (st_data_t)key;
- st_delete(stenv, &stkey, NULL);
+ st_data_t stkey = (st_data_t)key;
+ st_delete(stenv, &stkey, NULL);
}
else {
- st_insert(stenv, (st_data_t)key, (st_data_t)val);
+ st_insert(stenv, (st_data_t)key, (st_data_t)val);
+ OBJ_WRITTEN(envtbl, Qundef, key);
+ OBJ_WRITTEN(envtbl, Qundef, val);
}
}
}
envp_buf = rb_str_buf_new(0);
hide_obj(envp_buf);
- st_foreach(RHASH_TBL(envtbl), fill_envp_buf_i, (st_data_t)envp_buf);
+ st_foreach(RHASH_TBL_RAW(envtbl), fill_envp_buf_i, (st_data_t)envp_buf);
envp_str = rb_str_buf_new(sizeof(char*) * (RHASH_SIZE(envtbl) + 1));
hide_obj(envp_str);
p = RSTRING_PTR(envp_buf);
diff --git a/vm.c b/vm.c
index cef29978a2..d5cb3544dd 100644
--- a/vm.c
+++ b/vm.c
@@ -2212,7 +2212,7 @@ static int
kwmerge_i(VALUE key, VALUE value, VALUE hash)
{
if (!SYMBOL_P(key)) Check_Type(key, T_SYMBOL);
- if (st_update(RHASH_TBL(hash), key, kwmerge_ii, (st_data_t)value) == 0) { /* !existing */
+ if (st_update(RHASH_TBL_RAW(hash), key, kwmerge_ii, (st_data_t)value) == 0) { /* !existing */
OBJ_WRITTEN(hash, Qundef, value);
}
return ST_CONTINUE;
@@ -2675,7 +2675,7 @@ VALUE rb_insn_operand_intern(rb_iseq_t *iseq,
#if VM_COLLECT_USAGE_DETAILS
-#define HASH_ASET(h, k, v) st_insert(RHASH_TBL(h), (st_data_t)(k), (st_data_t)(v))
+#define HASH_ASET(h, k, v) rb_hash_aset((h), (st_data_t)(k), (st_data_t)(v))
/* uh = {
* insn(Fixnum) => ihash(Hash)