Skip to content

Do not deduplicate strings with ivars#6899

Merged
headius merged 2 commits intojruby:masterfrom
headius:string_dedup_ivars
Oct 25, 2021
Merged

Do not deduplicate strings with ivars#6899
headius merged 2 commits intojruby:masterfrom
headius:string_dedup_ivars

Conversation

@headius
Copy link
Member

@headius headius commented Oct 21, 2021

CRuby 2.7 and earlier return the same string, frozen, when the string has instance variables. This differs from JRuby 9.3 and Ruby 3.0 behavior, which always returns the interned string, possibly losing the original instance variables or metaclass.

The 3.0 behavior will need to be restored for JRuby 9.4.

This appears to fix the issues demonstrated in #6895.

This is different in Ruby 3.0, which appears to deduplicate and
return a new string always. The 3.0 behavior will need to be
preserved in JRuby 9.4.
@headius headius added this to the JRuby 9.3.2.0 milestone Oct 21, 2021
@headius headius merged commit d58685b into jruby:master Oct 25, 2021
@headius headius deleted the string_dedup_ivars branch October 25, 2021 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant