Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information