This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: messages in objective-C
- From: Andrew Pinski <pinskia at gmail dot com>
- To: Come Lonfils <Come dot Lonfils at ulb dot ac dot be>
- Cc: gcc at gcc dot gnu dot org
- Date: Thu, 07 Dec 2006 22:54:42 -0800
- Subject: Re: messages in objective-C
- References: <20061206161946.1685367F@bonito.ulb.ac.be>
On Wed, 2006-12-06 at 17:19 +0100, Come Lonfils wrote:
> Hi,
> I'm trying to know more about how messages are send to the objects in objective-C
Messages are send via a dynamic lookup using strings.
For the GNU runtime, objc_msg_lookup is called to get the function
pointer and then we cast it to the "correct" type and calls the function
pointer.
> , how they are store,...
At runtime, they are stored in a hashtable (at least for the GNU
runtime) for most cases.
> In which structures en how?
MethodList_t at the startup time in the GNU runtime (as defined in
objc/objc-api.h in libobjc).
> Where should I look in the source code of gcc to know it?
objc-act.c
I don't know how much about how the NeXT runtime works except instead of
a function pointer, it uses a call to a function to call the messages.
Thanks,
Andrew Pinski