[MacRuby-devel] [MacRuby] #505: ivars are not collected after they are re-assigned by an immediate value

MacRuby ruby-noreply at macosforge.org
Mon Dec 14 18:16:41 PST 2009


#505: ivars are not collected after they are re-assigned by an immediate value
-----------------------------------+----------------------------------------
 Reporter:  lsansonetti@…          |       Owner:  lsansonetti@…        
     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/>



More information about the MacRuby-devel mailing list