Implement GC.config [Ruby 3.4] #9094
Open
+26
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This uses a trivial implementation that satisfies MRI's interface. Spec is here: ruby/spec#1306
This PR is to familiarize myself with JRuby, so please, do not hesitate to point out how to do things correctly! A couple things I'm not sure about:
IsI've decided to just use the default, there is probably no reason to complicate this."java"string created correctly, considering non-default Encoding? This probably isn't actually needed, a default encoding should be fine, I only usesnewUSASCIIStringfor full compatiblity.ArgumentErrorwithout specifying a message?I haven't actually tested this code, and there don't seem to be any tests for
GC, so there may need to be further actions on my part.On a separate note, I believe that all "module = true" annotation options on
GCare actually supposed to be "meta", asGCdoes not usemodule_function. And what doesvisibility = PRIVATEdo here?