summaryrefslogtreecommitdiff
path: root/process.c
diff options
context:
space:
mode:
authorcharliesome <charliesome@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-08 00:41:01 +0000
committercharliesome <charliesome@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-08 00:41:01 +0000
commite0290c94042eadc5f131f22575b48e1138a974cf (patch)
treed46a5d13b1262fa8792ec61c649019f69c24dbf5 /process.c
parent0aada281599eb7f764cc9cab6855d44d58deed03 (diff)
* 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 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44052 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'process.c')
-rw-r--r--process.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/process.c b/process.c
index 5b328b3..b40cc25 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);