discuss-gnustep
[Top][All Lists]
Advanced

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

Re: MulleEOInterface


From: Dirk Theisen
Subject: Re: MulleEOInterface
Date: Mon, 26 May 2003 08:04:54 +0000
User-agent: Ginko/0.2.0-alpha-N (See <http://www.objectpark.org>)

Hi!

this stuff was probably there to speed things up (Nat! is a
well-respected speed optimization fanatic).

You can use the following on Apple/GNUstep:

#ifndef GNU_RUNTIME /* NeXT RUNTIME */

#define EDObjcMsgSend(obj, sel) objc_msgSend((obj), (sel))
#define EDObjcMsgSend1(obj, sel, obj1) objc_msgSend((obj), (sel),
(obj1))
#define EDObjcMsgSend2(obj, sel, obj1, obj2) objc_msgSend((obj),
#(sel),
(obj1), (obj2))
#define EDObjcMsgSend3(obj, sel, obj1, obj2, obj3)
#objc_msgSend((obj),
(sel), (obj1), (obj2), (obj3))

#else /* GNU_RUNTIME */

#define EDObjcMsgSend(obj, sel) objc_msg_lookup((obj), (sel))((obj),
(sel))
#define EDObjcMsgSend1(obj, sel, obj1) objc_msg_lookup((obj),
(sel))((obj), (sel), (obj1))
#define EDObjcMsgSend2(obj, sel, obj1, obj2) objc_msg_lookup((obj),
(sel))((obj), (sel), (obj1), (obj2))
#define EDObjcMsgSend3(obj, sel, obj1, obj2, obj3)
objc_msg_lookup((obj), (sel))((obj), (sel), (obj1), (obj2), (obj3))

#endif


Ok, thanks, but then, in the GNU case, you have to be careful of the
side effects lest you should lose performance or more evil things
happen. In this special case it was

 objc_msgSend([objects objectAtIndex: i], selector, argument)

which after expansion will search the array twice.

Maybe this should be "static inline" functions then?

Dirk



reply via email to

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