summaryrefslogtreecommitdiff
path: root/spec/ruby/shared/queue/empty.rb
diff options
context:
space:
mode:
authorAaron Patterson <tenderlove@ruby-lang.org>2021-02-01 11:10:22 -0800
committerAaron Patterson <tenderlove@ruby-lang.org>2021-02-01 12:20:34 -0800
commit8ef30bcc047341b2b7e6ec9b545dda975cdd4ab2 (patch)
treeacd942dc7c7845084d62a4662cfd4ba67c3f5cfb /spec/ruby/shared/queue/empty.rb
parent5803ac1c734568837d2010bd38f122ba24cbae2b (diff)
Fix GC compatibility: Don't stash encodings in global constants
This value should either be pinned, or looked up when needed at runtime. Without pinning, the GC may move the encoding object, and that could cause a crash. In this case it is easier to find the value at runtime, and there is no performance penalty (as Ruby caches encoding indexes). We can shorten the code, be compaction friendly, and incur no performance penalty.
Diffstat (limited to 'spec/ruby/shared/queue/empty.rb')
0 files changed, 0 insertions, 0 deletions