discuss-gnustep
[Top][All Lists]
Advanced

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

Re: ffcall - forward:: or forwardInvocation


From: woudshoo
Subject: Re: ffcall - forward:: or forwardInvocation
Date: Sun, 19 Aug 2001 08:17:39 +0200 (CEST)

> Adam Fedor wrote:
> 
>> Marko Mikulicic wrote:
>> 
>>> Hello,
>>>
>>> Trying to a fix gstep-db forwarding problem I noticed that
>>> ffcall-compiled base libs skip -[forward::] and call directly
>>> -[forwardInvocation:]. If a class does only implement -[forward::] it
>>> goes in infinite recursion and crashes.

I know nothing about gstep-db, but why does it crash?  If you
only implement -[forward::] the implementation should throw
an exception.  (Time to check the OpenStep specification)

[Note:  I just tested it and it indeed goes into
an infinite recursion.  This is a bug in GNUstep]

>>> Why does NSProxy implement -[forward::] just to pass to 
>>> -[forwardInvocation:] ?

Basically yes.  GNUstep in combination with ffcall and
newer objC runtimes implements its own forwarding and will
call -[forwardInvocation:] directly.  
If the GNUstep forwarding code can not be used
the -[forward::] passes to -[forwardInvocatin:]
to make forwarding comply with the OpenStep specs.

>>> Did the gstep-db devels use -[forward::] because of the lesser
>>> overhead or because it's required for a root class ?

It is not required of a root class.  


> 
> I thought that the forwardInvocation: was called by the forward::
> implementation of NSObject, which behavior is intherited by all,
> but root classes like EOFault. Probably the IMP of NSObject's forward::
> is stored somewhere and it's called with static binding.

NO, the NSObject's -[forward::] is not used at all 
if GNUstep is configured with ffcall.

> If I understood correcty then gstep-db code should migrate to 
> forwardInvocation: interface ?

Well, I am not sure.  At the moment GNUstep changes
the runtime behaviour.  It used to call -[forward::] 
but it does not anymore.  This is fine with respect
to the OpenStep specification, but it seems overly
harsh on code that does not use NSObject, but for
example just Object or another root class.  

I think GNUstep should be changed so that it will
be compatible with old implementations.

>From the top of my head there are two solutions:

A.  GNUstep forwarding checks if it the target 
    inherits from a 
    * OpenStep class
      then check for -[forwardInvocation:]
      if not exist throw an exception.
    * a non OpenStep class
      check for -[forward::]
      if not exist throw an exception.

B.  GNUstep forwarding checks if the target
    implements -[forwardInvocation:]
    if not check for -[forward::]
    if all else fails raise an exception.

I'll vote for B :-)   But a less
well thought idea of mine along the seem lines
was not well liked by Richard Frith-Macdonald.

But it seems that we have a real problem here, 
I do not like it that GNUstep changes the semantics
of runtime.  (Mr. Stes will have field day when
he hears of this).

So could Adam Fedor or Richard Firth-Macdonald
take a decision/give suggestions on this?

Wim Oudshoorn. 






reply via email to

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