Project

General

Profile

Feature #17256

Updated by sawa (Tsuyoshi Sawada) over 3 years ago

To be shared share Regexp objects between ractors, Regexp objects these regexps should be frozen. 

 Now, Matz has proposed to make all Regexp objects frozen. 

 Ten months 10 month ago, there was is a note note: 
 On https://bugs.ruby-lang.org/issues/16377#note-7 : 

 
 > For the record: Regexp.new should continue to return unfrozen Regexp instance. 

 So 
 so I'm not sure whether afraid it is a good way or not. 

 Could you give me your comment on it? 

 If no comments are given, comments, I'll try to freeze them , before Ruby 3.0 preview 2. 

 BTW, I believe `/#{expr}/o` should be frozen because this expression only returns one Regexp object. 

Back