summaryrefslogtreecommitdiff
path: root/marshal.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-21 11:22:18 (GMT)
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-21 11:22:18 (GMT)
commit6a1101f23ea403a8825c2f361508eeb85878b011 (patch)
tree89d04376f051f7aa2062fb9c1a46313b2ed22b49 /marshal.c
parentc54a1abde3753fe94176ef959342a5972eae0e73 (diff)
* include/ruby/ruby.h: support write barrier protection for T_STRUCT.
Introduce the following C APIs: * RSTRUCT_RAWPTR(st) returns pointer (do WB on your risk). The type of returned pointer is (const VALUE *). * RSTRUCT_GET(st, idx) returns idx-th value of struct. * RSTRUCT_SET(st, idx, v) set idx-th value by v with WB. And * RSTRUCT_PTR(st) returns pointer with shady operation. The type of returned pointer is (VALUE *). * struct.c, re.c, gc.c, marshal.c: rewrite with above APIs. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41534 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'marshal.c')
-rw-r--r--marshal.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/marshal.c b/marshal.c
index 9df02f3..0884b75 100644
--- a/marshal.c
+++ b/marshal.c
@@ -821,7 +821,7 @@ w_object(VALUE obj, struct dump_arg *arg, int limit)
mem = rb_struct_members(obj);
for (i=0; i<len; i++) {
w_symbol(SYM2ID(RARRAY_AREF(mem, i)), arg);
- w_object(RSTRUCT_PTR(obj)[i], arg, limit);
+ w_object(RSTRUCT_GET(obj, i), arg, limit);
}
}
break;