diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-04-10 10:16:24 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-04-10 10:16:24 +0000 |
commit | f19bf5ba5a59631e9d6340d3352b9d9ef20945af (patch) | |
tree | 6e04f04b4eb78ccd42315e7b17f343c9a25e005c /array.c | |
parent | be512007850642da7a02dae0460a2d4f2eea538a (diff) | |
download | ruby-f19bf5ba5a59631e9d6340d3352b9d9ef20945af.tar.gz |
* 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.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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); + } } } |