From 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sun, 7 Apr 2024 13:41:34 -0500 Subject: new repository --- .../what-you-can-and-what-you-cannot-do-in-_002bload.html | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 devdocs/gcc~13/what-you-can-and-what-you-cannot-do-in-_002bload.html (limited to 'devdocs/gcc~13/what-you-can-and-what-you-cannot-do-in-_002bload.html') diff --git a/devdocs/gcc~13/what-you-can-and-what-you-cannot-do-in-_002bload.html b/devdocs/gcc~13/what-you-can-and-what-you-cannot-do-in-_002bload.html new file mode 100644 index 00000000..1863ed91 --- /dev/null +++ b/devdocs/gcc~13/what-you-can-and-what-you-cannot-do-in-_002bload.html @@ -0,0 +1,14 @@ +

8.2.1 What You Can and Cannot Do in +load

+load is to be used only as a last resort. Because it is executed very early, most of the Objective-C runtime machinery will not be ready when +load is executed; hence +load works best for executing C code that is independent on the Objective-C runtime.

The +load implementation in the GNU runtime guarantees you the following things:

In particular, the following things, even if they can work in a particular case, are not guaranteed:

You should make no assumptions about receiving +load in sibling classes when you write +load of a class. The order in which sibling classes receive +load is not guaranteed.

The order in which +load and +initialize are called could be problematic if this matters. If you don’t allocate objects inside +load, it is guaranteed that +load is called before +initialize. If you create an object inside +load the +initialize method of object’s class is invoked even if +load was not invoked. Note if you explicitly call +load on a class, +initialize will be called first. To avoid possible problems try to implement only one of these methods.

The +load method is also invoked when a bundle is dynamically loaded into your running program. This happens automatically without any intervening operation from you. When you write bundles and you need to write +load you can safely create and send messages to objects whose classes already exist in the running program. The same restrictions as above apply to classes defined in bundle.

+

+ © Free Software Foundation
Licensed under the GNU Free Documentation License, Version 1.3.
+ https://gcc.gnu.org/onlinedocs/gcc-13.1.0/gcc/What-you-can-and-what-you-cannot-do-in-_002bload.html +

+
-- cgit v1.2.3