Thanks to answer Laurent. On Sat, Apr 10, 2010 at 9:47 PM, Laurent Sansonetti <[email protected]>wrote:
> Hi Daniel, > > MacRuby uses the Objective-C garbage collector, and also runs the > Objective-C runtime in GC mode. It basically means that you can use Cocoa > objects without the need to retain/release them, and they will be > automatically collected at runtime once there is no reference to them > anymore. This is also true for pure Ruby code. > > Please note that the collector is not deterministic and runs on its own > thread(s) (and also collects memory from there). So, setting variables to > nil or calling GC.start can help but there is no guarantee that the objects > will be immediately freed. > > In general you should not care about these issues. Just don't think about > managing memory and it should work fine. If you find a problematic case, let > us know :-) > > Laurent > > On Apr 10, 2010, at 8:44 AM, Daniel Lopes wrote: > > > Hello, I would like to know more about the garbage collector. In Obj-c > even when we have GC enabled we should set nil to the vars (which sometimes > is also useful in pure ruby). Correct me if I'm wrong but in MacRuby we > can't use GDB, right? We still able to use profile tools? I should set all > vars to nil or it will be treated like normal ruby code and I need set to > nil only the objects that I want to be released now? > > > > Thanks. > > _______________________________________________ > > 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 >
_______________________________________________ MacRuby-devel mailing list [email protected] http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
