aboutsummaryrefslogtreecommitdiff
path: root/libobjc/objc
diff options
context:
space:
mode:
authorNicola Pero <nicola.pero@meta-innovation.com>2010-10-15 22:27:39 +0000
committerNicola Pero <nicola@gcc.gnu.org>2010-10-15 22:27:39 +0000
commit51194e8eb5db1667efce48ef06a37436ca7ea7de (patch)
tree4a6954b1f7b91675bedaa8e8b7d3351ee0f9d7d7 /libobjc/objc
parentef7659966d956c7dcb34fad217fffafc1911f69d (diff)
downloadgcc-51194e8eb5db1667efce48ef06a37436ca7ea7de.zip
gcc-51194e8eb5db1667efce48ef06a37436ca7ea7de.tar.gz
gcc-51194e8eb5db1667efce48ef06a37436ca7ea7de.tar.bz2
In libobjc/: 2010-10-15 Nicola Pero <nicola.pero@meta-innovation.com>
In libobjc/: 2010-10-15 Nicola Pero <nicola.pero@meta-innovation.com> * objc-private/runtime.h (__objc_update_classes_with_methods): New. * class.c (__objc_update_classes_with_methods): New. (objc_getClassList): Do not lock the class lock. * methods.c (method_exchangeImplementations): New. (method_setImplementation): New. * objc/runtime.h (method_setImplementation): New. (method_exchangeImplementations): New. From-SVN: r165525
Diffstat (limited to 'libobjc/objc')
-rw-r--r--libobjc/objc/runtime.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/libobjc/objc/runtime.h b/libobjc/objc/runtime.h
index 9380331..bb241ac 100644
--- a/libobjc/objc/runtime.h
+++ b/libobjc/objc/runtime.h
@@ -545,7 +545,26 @@ objc_EXPORT void method_getReturnType (Method method, char *returnValue,
objc_EXPORT void method_getArgumentType (Method method, unsigned int argumentNumber,
char *returnValue, size_t returnValueSize);
-
+/* Change the implementation of the method. It also searches all
+ classes for any class implementing the method, and replaces the
+ existing implementation with the new one. For that to work,
+ 'method' must be a method returned by class_getInstanceMethod() or
+ class_getClassMethod() as the matching is done by comparing the
+ pointers; in that case, only the implementation in the class is
+ modified. Return the previous implementation that has been
+ replaced. If method or implementation is NULL, do nothing and
+ return NULL. */
+objc_EXPORT IMP
+method_setImplementation (Method method, IMP implementation);
+
+/* Swap the implementation of two methods in a single, atomic
+ operation. This is equivalent to getting the implementation of
+ each method and then calling method_setImplementation() on the
+ other one. For this to work, the two methods must have been
+ returned by class_getInstanceMethod() or class_getClassMethod().
+ If 'method_a' or 'method_b' is NULL, do nothing. */
+objc_EXPORT void
+method_exchangeImplementations (Method method_a, Method method_b);
/** Implementation: the following functions are in protocols.c. */