Re: [MacRuby-devel] WeakRef advice
Hi Laurent, Thanks for the response. In essence the problem I have is something like this: Object 'A' is created, then to handle Key Value Observing, Object 'B' is created which holds an instance variable to Object 'A'. 'B' is held in a hash or array somewhere. Object 'B' only has a purpose while 'A', is in use, when this is no longer the case I want 'B' to self destruct. However, 'B' is held in a hash and holds a reference to 'A', so neither object goes out of scope and neither can be garbage collected. If I changed the implementation perhaps I could avoid this problem, though I'm not sure what the solution would be as yet. al On 14 Feb 2011, at 22:09, Laurent Sansonetti wrote: > Hi Alan, > > MacRuby should have the same problem. ObjectSpace._id2ref in MacRuby > basically maps an object pointer value to a numerical description, and the GC > recycles objects. > > I am curious why you need weak references, though. MacRuby is able to detect > and deal with reference cycles, so you shouldn't need to worry about leaks. > Is there another use case that I'm forgetting? > > Laurent ___ MacRuby-devel mailing list [email protected] http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
[MacRuby-devel] Any interest in a better debugger than ruby-debug for MacRuby?
Is there interest in funding someone to work on a better debugger than ruby-debug MacRuby? Over the last decade or so, I've been writing debuggers as a work-related hobby. I'm looking for work, and I thought maybe I should try to do something related to debuggers. I currently maintain ruby-debug but have rewritten that for Rubinius and a patched version of YARV 1.9.2. If anyone's interested, please contact me privately for my resume and more details. ___ MacRuby-devel mailing list [email protected] http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Re: [MacRuby-devel] WeakRef advice
Hi Alan, Do you control the data structure that holds a reference to 'B'? If yes, you may want to use NSHashTable which supports weak references. To me, this sounds like a design problem. Maybe your project can be re-architectured to avoid this pattern. Laurent On Feb 15, 2011, at 12:22 AM, Alan Skipp wrote: > Hi Laurent, > Thanks for the response. In essence the problem I have is something like this: > > Object 'A' is created, then to handle Key Value Observing, Object 'B' is > created which holds an instance variable to Object 'A'. 'B' is held in a hash > or array somewhere. Object 'B' only has a purpose while 'A', is in use, when > this is no longer the case I want 'B' to self destruct. However, 'B' is held > in a hash and holds a reference to 'A', so neither object goes out of scope > and neither can be garbage collected. > > If I changed the implementation perhaps I could avoid this problem, though > I'm not sure what the solution would be as yet. > > al > > On 14 Feb 2011, at 22:09, Laurent Sansonetti wrote: > >> Hi Alan, >> >> MacRuby should have the same problem. ObjectSpace._id2ref in MacRuby >> basically maps an object pointer value to a numerical description, and the >> GC recycles objects. >> >> I am curious why you need weak references, though. MacRuby is able to detect >> and deal with reference cycles, so you shouldn't need to worry about leaks. >> Is there another use case that I'm forgetting? >> >> Laurent > > ___ > MacRuby-devel mailing list > [email protected] > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel ___ MacRuby-devel mailing list [email protected] http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Re: [MacRuby-devel] Any interest in a better debugger than ruby-debug for MacRuby?
Hi Rocky, I don't know if you are aware of that, but MacRuby has its own debugger: macrubyc. It does miss a nice UI and Xcode integration but it works quite well, if you were to be contracted out to work on a debugger, you might want to start there. - Matt On Tue, Feb 15, 2011 at 3:10 PM, Rocky Bernstein wrote: > Is there interest in funding someone to work on a better debugger than > ruby-debug MacRuby? > > Over the last decade or so, I've been writing debuggers as a work-related > hobby. I'm looking for work, and I thought maybe I > should try to do something related to debuggers. > > I currently maintain ruby-debug but have rewritten that for Rubinius and a > patched version of YARV 1.9.2. > > If anyone's interested, please contact me privately for my resume and more > details. > > ___ > MacRuby-devel mailing list > [email protected] > http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel > > ___ MacRuby-devel mailing list [email protected] http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
