From: Charles Oliver Nutter Date: 2007-10-29T02:13:30+09:00 Subject: Re: JRuby disabling ObjectSpace: what implications? Ken Bloom wrote: > I don't think they're making ObjectSpace go away. Just > ObjectSpace#each_object. Correct. > On Sun, 28 Oct 2007 22:13:38 +0900, Daniel Berger wrote: >> drb: This could be a big deal. >> weakref: You've stated that Java has its own implementation. > > This uses _id2ref, which doesn't appear to be going away. Not that I wouldn't like it to :) >> cgi: This could be a problem. Then again, some people say this library >> should be refactored or tossed. >> finalize: Did anyone even know about this? Does anyone use it? >> tempfile: Meh, I'm guessing Java has its own library for temp files. I >> never liked the current implementation anyway (which is why I wrote >> file-temp). > > Finalizers could be implemented using Java's finalize() method for > classes that need it. This method of implementing finalizers could > probably be compatibly exposed using ObjectSpace. Correct; we do support finalizers already. They weren't actually that hard to support, since as you say Java already supports finalization. >> shell: This could be a problem. > > This looks broken anyway since it uses fork. Ahh yes, fork is a killer. We will never, ever support fork. >> singleton: Ditto. > > one is in documentation comment, giving an example of a specific behavior > of the library. the other is in the same example, included executably > after an if __FILE__ == $0 condition. So no actual problem here. Whew, that's good to hear. I know singleton is used a bit in Rails, and most people run JRuby on Rails with ObjectSpace disabled...so this seems to fit with your findings. >> irb: You've got jirb. > > jirb is (at its core) still the Ruby 1.8 IRB codebase. The example you > pointed ou is class (Module) iteration, used for completion, but it's > more general iteration than test/unit uses, and #inherited techniques > that can be used for test/unit may not work here. inherited, perhaps not. But a JRuby-internal weak list of Module instances would put this one to rest. - Charlie