Actions
Bug #17343
closedRactor can't clone frozen structures
Updated by ko1 (Koichi Sasada) about 4 years ago
- Status changed from Open to Closed
Applied in changeset git|8247b8eddeb2a504a5c9776d1f77d413c8146897.
should not use rb_ary_modify()
ractor_copy() used rb_ary_modify() to make sure this array is not
sharing anything, but it also checks frozen flag. So frozen arrays
raises an error. To solve this issue, this patch introduces new
function rb_ary_cancel_sharing() which makes sure the array does not
share another array and it doesn't check frozen flag.
[Bug #17343]
A test is quoted from https://github.com/ruby/ruby/pull/3817
Updated by marcandre (Marc-Andre Lafortune) about 4 years ago
- Status changed from Closed to Open
Cool. You'll need to do the same for strings though...
$ ruby -e 'Ractor.new(String.new.instance_eval { @x = []; freeze}){}'
<internal:ractor>:38:in `new': can't modify frozen #<Class:#<String:0x00007fec13883478>>: "" (FrozenError)
from -e:1:in `<main>'
Updated by ko1 (Koichi Sasada) about 4 years ago
- Status changed from Open to Closed
fixed 764de7566ffa3fe828abf13ec93d76515ba27dd1
Actions
Like0
Like0Like0Like0