[Kde-bindings] Ruby 1.9.x GC.stress + qtruby ([BUG] object allocation during garbage collection phase)

Richard Dale rdale at foton.es
Fri Mar 13 10:00:19 UTC 2009


On Friday 13 March 2009 08:39:19 Cyrille Berger wrote:
> On Thursday 12 March 2009, Richard Dale wrote:
> > I think turning off virtual method callbacks during GC is more reliable.
> > But I had thought of caching the result for a virtual method callback
> > test, so it only has to be done once for an instance (or once per Ruby
> > class perhaps). It needs a bit more thought.
>
> Not sure if I did understood correctly what you want to cache :) But
> wouldn't that be a problem if the virtual function is added after the test
> ? Would the function still be called ? Or would the caching prevent that ?
Yes, the problem with Ruby is that it is very dynamic and you can add methods 
at runtime, and you can also add virtual method overrides to individual 
instances, as well as to the class. So it is a bit tricky to decide what to 
do, which is why I haven't changed it so far. I we use 'respond_to' we know it 
will always be correct. 

There is the problem of it not working with lowercase/underscores method 
naming to - a test for 'item_at' needs to be done as well as 'itemAt' when 
testing if a virtual method has been overriden. I didn't want to have two 
respond_to tests for every virtual method override callback. 

> > We could also change the smoke library code generation so that there
> > would be a flag for each virtual method call, and set that after the
> > first test, instead of testing each time.




More information about the Kde-bindings mailing list