[#60404] is RB_GC_GUARD needed in rb_io_syswrite? — Eric Wong <normalperson@...>
I haven't gotten it to crash as-is, but it seems like we need to
4 messages
2014/02/01
[#60682] volatile usages — Eric Wong <normalperson@...>
Hi all, I went ahead and removed some use of volatile which were once
5 messages
2014/02/13
[#60794] [RFC] rearrange+pack vtm and time_object structs — Eric Wong <normalperson@...>
Extracted from addendum on top of Feature #9362 (cache-aligned objects).
4 messages
2014/02/16
[#61139] [ruby-trunk - Feature #9577] [Open] [PATCH] benchmark/driver.rb: align columns in text output — normalperson@...
Issue #9577 has been reported by Eric Wong.
3 messages
2014/02/28
[ruby-core:60682] volatile usages
From:
Eric Wong <normalperson@...>
Date:
2014-02-13 10:04:36 UTC
List:
ruby-core #60682
Hi all, I went ahead and removed some use of volatile which were once
needed, but no longer. (r44929. r44930)
I'm not sure about the reason for the volatile VALUE v in re.c:
rb_reg_s_union, so I'm leaving it alone.
Also, in string.c, I'm not sure if the volatile declaration is enough,
using RB_GC_GUARD below seems more correct (and generates smaller code
on x86-32, at least):
--- a/string.c
+++ b/string.c
@@ -1401,10 +1401,12 @@ rb_str_times(VALUE str, VALUE times)
static VALUE
rb_str_format_m(VALUE str, VALUE arg)
{
- volatile VALUE tmp = rb_check_array_type(arg);
+ VALUE tmp = rb_check_array_type(arg);
if (!NIL_P(tmp)) {
- return rb_str_format(RARRAY_LENINT(tmp), RARRAY_CONST_PTR(tmp), str);
+ VALUE rv = rb_str_format(RARRAY_LENINT(tmp), RARRAY_CONST_PTR(tmp), str);
+ RB_GC_GUARD(tmp);
+ return rv;
}
return rb_str_format(1, &arg, str);
}