From 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sun, 7 Apr 2024 13:41:34 -0500 Subject: new repository --- devdocs/gcc~13/messaging-with-the-gnu-objective-c-runtime.html | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 devdocs/gcc~13/messaging-with-the-gnu-objective-c-runtime.html (limited to 'devdocs/gcc~13/messaging-with-the-gnu-objective-c-runtime.html') diff --git a/devdocs/gcc~13/messaging-with-the-gnu-objective-c-runtime.html b/devdocs/gcc~13/messaging-with-the-gnu-objective-c-runtime.html new file mode 100644 index 00000000..84f4b828 --- /dev/null +++ b/devdocs/gcc~13/messaging-with-the-gnu-objective-c-runtime.html @@ -0,0 +1,6 @@ +

8.10 Messaging with the GNU Objective-C Runtime ΒΆ

This section is specific for the GNU Objective-C runtime. If you are using a different runtime, you can skip it.

The implementation of messaging in the GNU Objective-C runtime is designed to be portable, and so is based on standard C.

Sending a message in the GNU Objective-C runtime is composed of two separate steps. First, there is a call to the lookup function, objc_msg_lookup () (or, in the case of messages to super, objc_msg_lookup_super ()). This runtime function takes as argument the receiver and the selector of the method to be called; it returns the IMP, that is a pointer to the function implementing the method. The second step of method invocation consists of casting this pointer function to the appropriate function pointer type, and calling the function pointed to it with the right arguments.

For example, when the compiler encounters a method invocation such as [object init], it compiles it into a call to objc_msg_lookup (object, @selector(init)) followed by a cast of the returned value to the appropriate function pointer type, and then it calls it.

+

+ © Free Software Foundation
Licensed under the GNU Free Documentation License, Version 1.3.
+ https://gcc.gnu.org/onlinedocs/gcc-13.1.0/gcc/Messaging-with-the-GNU-Objective-C-runtime.html +

+
-- cgit v1.2.3