From: nobu.nokada@... Date: 2002-07-26T09:56:48+09:00 Subject: Re: A couple of questions on writing extensions Hi, At Fri, 26 Jul 2002 06:09:35 +0900, Matthew Bloch wrote: > *) what does 'Died with exception wrong argument type Object (expected Data)' > mean? Literally, you passed something else to the method expecting Data. > which is nothing to do with my converted class, but the error implies 'key' is > somehow corrupt or of the wrong type, where the same code worked before. > This exception seems to be thrown from different points depending on timing > (though more often than not in a simple call to a logger), which is pretty > difficult to track down. I vote GC issue. How do you define mark/free functions for Data_{Make,Wrap}_Struct? Could you show us the source? > *) Is this kind of construct safe as the end of a bog-standard native accessor > method? : Yes. > i.e. constructing a temporary object with the same value as the one inquired > about? Might it be garbage collected before being read by the Ruby caller? > Will it be garbage-collected when the result goes out of context in the > calling Ruby method? While it is referred by `self', never collected. > *) is this a correct way to call back a method implemented in class derived > from a C extension class? : Yes.