From: Kurt Stephens Date: 2011-01-13T05:57:49+09:00 Subject: [ruby-core:34448] [Ruby 1.9-Bug#4168] WeakRef is unsafe to use in Ruby 1.9 Issue #4168 has been updated by Kurt Stephens. Charles writes: | A GC callback API? There is no possibility of implementing such an API on JRuby. All the JVMs have different GC implementations, and there's no standard way to have GC callbacks into user code. Is that what you mean? No. I'm not proposing a GC API for JRuby because JREs already support WeakReferences, etc natively. To make C WeakRef an MRI ext/*.so, it needs a callback from MRI's GC after the mark phase. This will only be for MRI (or other Rubies that can/want to implement it in their C APIs). There maybe a couple functions/macros that will help make C WeakRef work with REE's COW-friendly mark bitmaps. A very minimal API. A few other reasons for exposing GC phases/internals to extensions: stats, efficient instance caches for value objects, etc. ---------------------------------------- http://redmine.ruby-lang.org/issues/show/4168 ---------------------------------------- http://redmine.ruby-lang.org