-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add workaround for Ruby garbage collection bug
The Ruby interpreter has a bug in `String#concat` where the appended array may be garbage collected prematurely because the compiler optimized out a Ruby stack variable. We now call `to_ary` on the Protobuf object to ensure the array lands on the Ruby stack so the garbage collector sees it. The real fix in the interpreter is described in https://bugs.ruby-lang.org/issues/18140#note-2, but most current Ruby interpreters won't have this fix for some time.
- Loading branch information
Showing
1 changed file
with
6 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters