diff options
author | Aaron Patterson <tenderlove@ruby-lang.org> | 2021-02-01 11:10:22 -0800 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2021-04-22 15:09:16 +0900 |
commit | a98c72a313483e1a0baebe99d2534904c19faf1f (patch) | |
tree | 6bb274744fd2edb245dfa6691aa6f8fc08cf410d /java/src | |
parent | 2a42c646a963ce559d20618e94a78244f799d376 (diff) | |
download | json-a98c72a313483e1a0baebe99d2534904c19faf1f.tar.gz |
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 'java/src')
0 files changed, 0 insertions, 0 deletions