Differences From Artifact [4bc8df336e]:
- File src/OFObject.m — part of check-in [382ed34d40] at 2010-03-13 21:24:16 on branch trunk — Add global variable of_pagesize and use it to reduce code duplication. (user: js, size: 15256) [annotate] [blame] [check-ins using]
To Artifact [95a9dc34dd]:
- File
src/OFObject.m
— part of check-in
[54e971a3a6]
at
2010-04-01 20:57:30
on branch trunk
— Improve method replacing when using the Apple runtime.
This prevents replacing the method of a superclass when the method is
not implemented in the class and creates a new method instead. (user: js, size: 15069) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
224 225 226 227 228 229 230 | #endif } + (IMP)setImplementation: (IMP)newimp forClassMethod: (SEL)selector { #ifdef OF_APPLE_RUNTIME | < | | < < < < | 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 | #endif } + (IMP)setImplementation: (IMP)newimp forClassMethod: (SEL)selector { #ifdef OF_APPLE_RUNTIME return class_replaceMethod(self->isa, selector, newimp, method_getTypeEncoding(class_getClassMethod(self, selector))); #else Method_t method; IMP oldimp; /* The class method is the instance method of the meta class */ if ((method = class_get_instance_method(self->class_pointer, selector)) == NULL) |
︙ | ︙ | |||
279 280 281 282 283 284 285 | forClassMethod: selector]; } + (IMP)setImplementation: (IMP)newimp forInstanceMethod: (SEL)selector { #ifdef OF_APPLE_RUNTIME | < | | < < < < | 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 | forClassMethod: selector]; } + (IMP)setImplementation: (IMP)newimp forInstanceMethod: (SEL)selector { #ifdef OF_APPLE_RUNTIME return class_replaceMethod(self, selector, newimp, method_getTypeEncoding(class_getInstanceMethod(self, selector))); #else Method_t method = class_get_instance_method(self, selector); IMP oldimp; if (method == NULL) @throw [OFInvalidArgumentException newWithClass: self selector: _cmd]; |
︙ | ︙ |