From: Kurt Stephens Date: 2011-01-12T11:17:12+09:00 Subject: [ruby-core:34400] [Ruby 1.9-Bug#4168] WeakRef is unsafe to use in Ruby 1.9 Issue #4168 has been updated by Kurt Stephens. Matz: are you suggesting renaming this C implementation "WeakPtr" (or something), make it part of Ruby core, and let the old WeakRef class die off? Should I take a crack at designing a GC callback API and make this an ext/*.so? Charles: If MRI will support a GC callback API, maybe I could add this to weakling and standardize a WeakPtr API for both JRuby, MRI and maybe Rubinius, Evan willing. ReferenceQueue seems to make more sense with generational/incremental GCs (as in many JREs) and it might be overkill/painful in MRIs straight-forward stop-mark-sweep GC. Would a standard Hash::WeakKey class suffice since everything else can be implemented in terms of WeakPtr? Or are you thinking that ReferenceQueue would make weak array, sets, lists, pairs, etc. easier in the long run? I'd rather not design something that isn't gonna jive with other Rubies. Anybody from the Rubinius team care to comment? ---------------------------------------- http://redmine.ruby-lang.org/issues/show/4168 ---------------------------------------- http://redmine.ruby-lang.org