[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
objc runtime problem
From: |
Richard Frith-Macdonald |
Subject: |
objc runtime problem |
Date: |
Thu, 26 Jun 2003 14:23:35 +0100 |
There is a problem with the forwarding mechanism we have at present...
When a message is sent to an object, and there is no method found to
handle it, the runtime calls the function registered as
_objc_msg_forward to ask for the method implementation to use. We use
this function to determine and return the correct method for forwarding
to work through a proxy, and to make a note of the information about
argument and return types, needed to set up the content of NSInvocation
obejcts etc.
Mostly this works fine.
However, there are two cases where it does not work -
1. Where there is more than one type signature for the selector name ...
(eg. -(void)foo; and -(struct abc)foo;) in which case we may not get
the correct type information.
2. Where the receiver is an object in a remote process, and there is no
type information associated with the message locally.
It is currently impossible for these cases to work, because the
_objc_msg_forward() function takes a single argument (the selector to
look up), but the type information which should be associated with the
selector depends on the receiver, and the compiler may have provided an
untyped selector, or one with the wrong type info for the receiver.
If sendmsg.c was modified to pass two arguments to the function, (the
second being the receiver), the function would be able to ask the
receiver for the type information and return a forwarding function
which would work for that receiver.
Is there any reason not to modify the runtime to work this way?
- objc runtime problem,
Richard Frith-Macdonald <=