Skip to content

Conversation

@trinistr
Copy link
Contributor

@trinistr trinistr commented Nov 22, 2025

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:

  • Is "java" string created correctly, considering non-default Encoding? This probably isn't actually needed, a default encoding should be fine, I only uses newUSASCIIString for full compatiblity. I've decided to just use the default, there is probably no reason to complicate this.
  • Is there a way to create an ArgumentError without 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. I've successfully built JRuby and tested this manually.

On a separate note, I believe that all "module = true" annotation options on GC are actually supposed to be "meta", as GC does not use module_function. And what does visibility = PRIVATE do here?

@headius
Copy link
Member

headius commented Nov 26, 2025

Very cool! I will review as soon as I can given the US holiday. Thank you for your efforts!

Copy link
Member

@headius headius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some change and discussion needed, but it's close.

This uses a trivial implementation that satisfies MRI's interface.
@headius headius merged commit 5c3ccaa into jruby:master Dec 2, 2025
77 checks passed
@headius headius added this to the JRuby 10.0.3.0 milestone Dec 2, 2025
@trinistr trinistr deleted the add-gc-config branch December 2, 2025 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants