#505: ivars are not collected after they are re-assigned by an immediate value -----------------------------------+---------------------------------------- Reporter: lsansone...@… | Owner: lsansone...@… Type: defect | Status: new Priority: blocker | Milestone: MacRuby 0.5 Component: MacRuby | Keywords: -----------------------------------+---------------------------------------- Good: {{{ $ ./miniruby -e "@foo = 'hey'; ocid = @foo.object_id; @foo = 'ok'; 1000.times { GC.start }; p ObjectSpace._id2ref(ocid)" Segmentation fault }}}
Not good: {{{ $ ./miniruby -e "@foo = 'hey'; ocid = @foo.object_id; @foo = nil; 1000.times { GC.start }; p ObjectSpace._id2ref(ocid)" "hey" }}} Re-assigning an instance variable (slot-based) using an immediate value doesn't emit a GC write barrier, therefore the old variable leaks. -- Ticket URL: <http://www.macruby.org/trac/ticket/505> MacRuby <http://macruby.org/> _______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel