Visitar URL original
Fix for GC of Ruby map frames. by haberman · Pull Request #6533 · protocolbuffers/protobuf · GitHub
Skip to content

Fix for GC of Ruby map frames. - #6533

Merged
TeBoring merged 1 commit into
protocolbuffers:masterfrom
haberman:map_gc_fix
Aug 22, 2019
Merged

TeBoring merged 1 commit into
protocolbuffers:masterfrom
haberman:map_gc_fix

Conversation

@haberman

Copy link
Copy Markdown
Member

We were creating a map decoding frame when starting the map,
but clearing the GC slot when finishing each map entry. This
means that the decoding frame could be collected in the meantime.

Hopefully this will fix #6532 (needs to be tested/verified).

I have not verified that this fixes anything yet, but it does seem to correct a correctness error in the previous code.

We were creating a map decoding frame when starting the *map*,
but clearing the GC slot when finishing each *map entry*.  This
means that the decoding frame could be collected in the meantime.
@TeBoring

Copy link
Copy Markdown
Contributor

The existing gc test only tests map with one key/value pair. Can we add more key/value pair into the test?
https://github.com/protocolbuffers/protobuf/blob/master/ruby/tests/gc_test.rb#L39

@TeBoring
TeBoring merged commit 780b050 into protocolbuffers:master Aug 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ruby concurrent map decoding sporadically has empty results

4 participants