…ity. Pointed out and initial patch by Chung Shin Yee <firstname.lastname@example.org>
…nks to Stephen Bannasch for pointing it out and providing an alternate fix.
…order on pointers
…6 and newer * Psych::SyntaxError should allocate a RubyException, not a RubyObject.
Close all selectors in SelectorPool explicitly at Ruby runtime termination. We need to call java.nio.channel.Selector#close() for freeing internal resource(s). For example, Selector implementation of Hotspot JVM for Linux uses 2 file descriptors(fd) per 1 instance and close() is the only way to release these fds. We kept soft-referenced selectors in a pool and let GC collect it. Since Selector does not have a finalizer 2 fds per each selector leaked after Ruby runtime was terminated, and creating many Ruby runtimes eventually caused 'Too many open files' error. Number of selectors in SelectorPool (== number of leaked fds after a runtime terminated) depends on numbers of maximum *concurrent* select operations in the runtime. It should not grow so much but we might need to release spare selectors while running in the future.
…ring + ByteList construction + Ruby String.
Did not work properly when begin != 0. There seems no similar bug exists.
JRuby uses the patched version of securerandom.rb for both 1.8 and 1.9 which utilizes java.security.SecureRandom. Using nextInt causes this RangeError for bit number so introduce CRuby's byte operation implementation.
…Plus, small refactoring to clear up who should be resposible to keep a local variable behavior value.
DynamicMethod now has setNotImplemented and isNotImplemented, to indicate whether this is a "not implemented" method. JRubyMethod annotations specify notImplemented = true to change from the default false. Only patched fork, because ideally notImplemented methods would have no bodies at all and share an invoker.
Patch by Rich Liebling.
Patch by Matt Woenker.
* 1.9 uses to_enum and next to walk uncoercible arguments.