[MacRuby-devel] [MacRuby] #142: Infinite loop creating new Monitor object

MacRuby ruby-noreply at macosforge.org
Sat Nov 22 21:39:18 PST 2008


#142: Infinite loop creating new Monitor object
---------------------------------------+------------------------------------
 Reporter:  dev@…                      |        Owner:  lsansonetti@…        
     Type:  defect                     |       Status:  closed               
 Priority:  major                      |    Milestone:  MacRuby 0.4          
Component:  MacRuby                    |   Resolution:  fixed                
 Keywords:                             |  
---------------------------------------+------------------------------------
Changes (by lsansonetti@…):

  * status:  new => closed
  * resolution:  => fixed


Comment:

 So I have been investigating different solutions to re-implement the mixin
 feature, but I was unsuccessful.

 My first attempt was to create intermediate classes and interpose them
 inside the ancestor chain, but this causes some problem with the 64-bit
 libobjc runtime (which does not authorize you to change the superclass of
 NSObject), it requires to allocate a complete class-pair (both the class
 and its metaclass) every time, and it does not work if you extend a
 singleton class.

 My second attempt was to monkey-patch the libobjc method lookup
 functionality to also look inside mixed modules at runtime. This was
 working but I could not make it stable (and also it's really evil). This
 was just to experiment a potential change that I would submit to the
 libobjc guys.

 My third attempt was the successful one, I basically used a solution very
 similar to Jamis' patch and removed the unnecessary code paths. When
 dispatching the super message we no longer forward it to the real
 superclass but use the Ruby ancestors chain.

 The problem should be fixed in r750.

-- 
Ticket URL: <http://www.macruby.org/trac/ticket/142#comment:8>
MacRuby <http://macruby.org/>



More information about the MacRuby-devel mailing list