Overview
Comment: | Reduce #ifdefs in OFObject.m. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
623c89300a2cc6ef7ab5c5a3de306410 |
User & Date: | js on 2010-02-07 14:15:35 |
Other Links: | manifest | tags |
Context
2010-02-10
| ||
20:30 | Documentation improvements. check-in: 6a65366467 user: js tags: trunk | |
2010-02-07
| ||
14:15 | Reduce #ifdefs in OFObject.m. check-in: 623c89300a user: js tags: trunk | |
14:09 | Add +[superclass] to OFObject. check-in: 047af7a8ad user: js tags: trunk | |
Changes
Modified src/OFObject.m from [eeb1a8282b] to [4674410a8d].
︙ | ︙ | |||
31 32 33 34 35 36 37 38 39 40 41 42 43 44 | #endif #ifdef OF_ATOMIC_OPS # import "atomic.h" #else # import "threading.h" #endif struct pre_ivar { void **memchunks; size_t memchunks_size; int32_t retain_count; /* int32_t because atomic ops use int32_t */ #ifndef OF_ATOMIC_OPS of_spinlock_t retain_spinlock; | > > > > > > > | 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | #endif #ifdef OF_ATOMIC_OPS # import "atomic.h" #else # import "threading.h" #endif /* A few macros to reduce #ifdefs */ #ifndef OF_APPLE_RUNTIME # define class_getInstanceSize class_get_instance_size # define class_getName class_get_name # define class_getSuperclass class_get_super_class #endif struct pre_ivar { void **memchunks; size_t memchunks_size; int32_t retain_count; /* int32_t because atomic ops use int32_t */ #ifndef OF_ATOMIC_OPS of_spinlock_t retain_spinlock; |
︙ | ︙ | |||
101 102 103 104 105 106 107 | + (void)initialize { } + alloc { OFObject *instance; | < < < < | 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 | + (void)initialize { } + alloc { OFObject *instance; size_t isize = class_getInstanceSize(self); if ((instance = malloc(isize + PRE_IVAR_ALIGN)) == NULL) { alloc_failed_exception.isa = [OFAllocFailedException class]; @throw (OFAllocFailedException*)&alloc_failed_exception; } ((struct pre_ivar*)instance)->memchunks = NULL; |
︙ | ︙ | |||
137 138 139 140 141 142 143 | + (Class)class { return self; } + (const char*)className { | < < < < < < < < < < < < | 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 | + (Class)class { return self; } + (const char*)className { return class_getName(self); } + (BOOL)isSubclassOfClass: (Class)class { Class iter; for (iter = self; iter != Nil; iter = class_getSuperclass(iter)) if (iter == class) return YES; return NO; } + (Class)superclass { return class_getSuperclass(self); } + (BOOL)instancesRespondToSelector: (SEL)selector { #ifdef OF_APPLE_RUNTIME return class_respondsToSelector(self, selector); #else |
︙ | ︙ | |||
284 285 286 287 288 289 290 | #endif } - (BOOL)isKindOfClass: (Class)class { Class iter; | < < < < | 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 | #endif } - (BOOL)isKindOfClass: (Class)class { Class iter; for (iter = isa; iter != Nil; iter = class_getSuperclass(iter)) if (iter == class) return YES; return NO; } - (BOOL)respondsToSelector: (SEL)selector |
︙ | ︙ |