summaryrefslogtreecommitdiff
path: root/libobjc/objc
diff options
context:
space:
mode:
authornicola <nicola@138bc75d-0d04-0410-961f-82ee72b054a4>2010-10-15 22:27:39 +0000
committernicola <nicola@138bc75d-0d04-0410-961f-82ee72b054a4>2010-10-15 22:27:39 +0000
commitcd9fd8f49ed8d1933887d048b692de11a2247e88 (patch)
tree4a6954b1f7b91675bedaa8e8b7d3351ee0f9d7d7 /libobjc/objc
parent4730466b5737baca4efd606025cb52b019fd6613 (diff)
downloadgcc-cd9fd8f49ed8d1933887d048b692de11a2247e88.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@165525 138bc75d-0d04-0410-961f-82ee72b054a4
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 938033148ae..bb241acd5b3 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. */