gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Forwarding and the GNU runtime one more time (was ANN: GNUstep 2.6.0


From: Nat!
Subject: Re: Forwarding and the GNU runtime one more time (was ANN: GNUstep 2.6.0 for openSUSE 11.4)
Date: Wed, 22 Jun 2011 12:02:51 +0200

Am 22.06.2011 um 11:38 schrieb Nicola Pero:

>> But I suppose the answer is again, I need two function calls for my purpose 
>> in the GNU runtime.
> 
> Yes.  I guess what you really want is a variant of 
> class_getMethodImplementation() which returns
> NULL (instead of a forwarding function) if the method is not implemented 
> directly by the class.
> But there is no such variant. ;-)
> 
Ok, thanks for the clarification. It's no problem, it's just good to know to 
make a decision how to rewrite the code.

> Any particular reason you need to make a difference between forwarded and 
> non-forwarded methods ?

Calling the forward IMP directly uglies the stacktrace in gdb at least on OS X 
(and at least at the time I wrote the code), which was too confusing in the 
long run.

I am not much a fan of lots of #ifdefs in my real code, what I need to rewrite 
is something like

      imp = (*context->lookup)( thisIsa, context->sel);
      if( imp == MulleObjCMsgForward)
         imp = MulleObjCMsgSend;

(where MulleObjCMsgForward == _objc_msgForward and MulleObjCMsgSend == 
objc_msgSend)

I tried to replace MulleObjCMsgForward and MulleObjCMsgSend with GCC runtime 
stuff, which I assumed at the time of writing, was basically just the same. But 
I suppose I will just lift the three lines into a small (inline) C function and 
that will be equally fine.

There is just lots of these kinds of lines in my code, and I wanted to save 
some typework if possible. Typework, coming to think of it, which I now spent 
on mailing list posts :)

Ciao
   Nat!
------------------------------------------------------
I suppose I live in a fantasy world, but at least they 
know me there. -- DLR




reply via email to

[Prev in Thread] Current Thread [Next in Thread]