summaryrefslogtreecommitdiff
path: root/array.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-04-10 10:16:24 (GMT)
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-04-10 10:16:24 (GMT)
commitf19bf5ba5a59631e9d6340d3352b9d9ef20945af (patch)
tree6e04f04b4eb78ccd42315e7b17f343c9a25e005c /array.c
parentbe512007850642da7a02dae0460a2d4f2eea538a (diff)
* array.c (rb_ary_modify): remember shared array owner if a shared
array owner is promoted and a shared array is not promoted. Now, shared array is WB-unprotected so that shared arrays are not promoted. All objects referred from shared array should be marked correctly. [ruby-core:61919] [ruby-trunk - Bug #9718] * test/ruby/test_array.rb: add a test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45553 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'array.c')
-rw-r--r--array.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/array.c b/array.c
index 7249ed7..1112a22 100644
--- a/array.c
+++ b/array.c
@@ -343,6 +343,11 @@ rb_ary_modify(VALUE ary)
ARY_SET_CAPA(ary, len);
ARY_SET_PTR(ary, ptr);
}
+
+ /* TODO: age2 promotion, OBJ_PROMOTED() checks not infant. */
+ if (OBJ_PROMOTED(ary) && !OBJ_PROMOTED(shared)) {
+ rb_gc_writebarrier_remember_promoted(ary);
+ }
}
}