Overview
Comment: | of_spinlock_t -> OFSpinlock |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | new-naming-convention |
Files: | files | file ages | folders |
SHA3-256: |
fabf53041a5f9277cfbc29b0d083b632 |
User & Date: | js on 2021-04-17 16:29:36 |
Other Links: | branch diff | manifest | tags |
Context
2021-04-17
| ||
16:36 | of_condition_t -> OFPlainCondition check-in: 20bfedd0b7 user: js tags: new-naming-convention | |
16:29 | of_spinlock_t -> OFSpinlock check-in: fabf53041a user: js tags: new-naming-convention | |
16:24 | of_mutex_t -> OFPlainMutex check-in: dfd52d5220 user: js tags: new-naming-convention | |
Changes
Modified src/OFBlock.m from [2e686f4654] to [f799cd3c36].
︙ | |||
165 166 167 168 169 170 171 | 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 | - - + + | static struct { Class isa; } alloc_failed_exception; #ifndef OF_HAVE_ATOMIC_OPS # define NUM_SPINLOCKS 8 /* needs to be a power of 2 */ # define SPINLOCK_HASH(p) ((uintptr_t)p >> 4) & (NUM_SPINLOCKS - 1) |
︙ | |||
200 201 202 203 204 205 206 | 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 | - + - + | if ([(id)block isMemberOfClass: (Class)&_NSConcreteMallocBlock]) { #ifdef OF_HAVE_ATOMIC_OPS of_atomic_int_inc(&block->flags); #else unsigned hash = SPINLOCK_HASH(block); |
︙ | |||
227 228 229 230 231 232 233 | 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 | - + - + - + | block->descriptor->dispose_helper(block); free(block); } #else unsigned hash = SPINLOCK_HASH(block); |
︙ | |||
292 293 294 295 296 297 298 | 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 | - + - + - + - + | free(*dst); *dst = src->forwarding; } #else unsigned hash = SPINLOCK_HASH(src); |
︙ | |||
353 354 355 356 357 358 359 | 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 | - + - + - + - - + + | object->byref_dispose(object); free(object); } #else unsigned hash = SPINLOCK_HASH(object); |
︙ |
Modified src/OFObject.m from [2771fd68a5] to [b4c19ab1e4].
︙ | |||
78 79 80 81 82 83 84 | 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | - + | # define of_forward of_method_not_found # define of_forward_stret of_method_not_found_stret #endif struct pre_ivar { int retainCount; #if !defined(OF_HAVE_ATOMIC_OPS) && !defined(OF_AMIGAOS) |
︙ | |||
304 305 306 307 308 309 310 | 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 | - + | allocFailedException.isa = [OFAllocFailedException class]; @throw (id)&allocFailedException; } ((struct pre_ivar *)instance)->retainCount = 1; #if !defined(OF_HAVE_ATOMIC_OPS) && !defined(OF_AMIGAOS) |
︙ | |||
1110 1111 1112 1113 1114 1115 1116 | 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 | - + - + | Forbid(); # endif PRE_IVARS->retainCount++; # ifndef OF_AMIGAOS_M68K Permit(); # endif #else |
︙ | |||
1146 1147 1148 1149 1150 1151 1152 | 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 | - + - + | Permit(); if (retainCount == 0) [self dealloc]; #else int retainCount; |
︙ |
Modified src/mutex.h from [3c75ad2bae] to [89d7ed7ceb].
︙ | |||
35 36 37 38 39 40 41 | 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | - + - + - + | #elif defined(OF_AMIGAOS) # include <exec/semaphores.h> typedef struct SignalSemaphore OFPlainMutex; #endif #if defined(OF_HAVE_ATOMIC_OPS) # import "atomic.h" |
︙ | |||
88 89 90 91 92 93 94 | 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 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 171 | - + - + - + - + - + - + - + | sched_yield(); #elif defined(OF_WINDOWS) Sleep(0); #endif } static OF_INLINE int |
Modified src/runtime/arc.m from [eaae2aa32a] to [6944c2266c].
︙ | |||
25 26 27 28 29 30 31 | 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | - + - + | struct weak_ref { id **locations; size_t count; }; static struct objc_hashtable *hashtable; #ifdef OF_HAVE_THREADS |
︙ | |||
116 117 118 119 120 121 122 | 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 | - + | id objc_storeWeak(id *object, id value) { struct weak_ref *old; #ifdef OF_HAVE_THREADS |
︙ | |||
173 174 175 176 177 178 179 | 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 | - + - + - + | ref->locations[ref->count++] = object; } else value = nil; *object = value; #ifdef OF_HAVE_THREADS |
︙ | |||
238 239 240 241 242 243 244 | 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 | - + - + - + - + | void objc_moveWeak(id *dest, id *src) { struct weak_ref *ref; #ifdef OF_HAVE_THREADS |
Modified src/runtime/exception.m from [5b9f454f5d] to [1a9cebf1f3].
︙ | |||
238 239 240 241 242 243 244 | 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 | - + - + | PCONTEXT, PDISPATCHER_CONTEXT, _Unwind_Reason_Code (*)(int, int, uint64_t, struct _Unwind_Exception *, struct _Unwind_Context *)); #endif static objc_uncaught_exception_handler_t uncaughtExceptionHandler; static struct objc_exception emergencyExceptions[NUM_EMERGENCY_EXCEPTIONS]; #ifdef OF_HAVE_THREADS |
︙ | |||
707 708 709 710 711 712 713 | 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 | - + - + - + - + | } static void emergencyExceptionCleanup(_Unwind_Reason_Code reason, struct _Unwind_Exception *ex) { #ifdef OF_HAVE_THREADS |
︙ |
Modified src/runtime/property.m from [9cb9ad8e02] to [f156577a86].
︙ | |||
20 21 22 23 24 25 26 | 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | - + - + - + - + - + - + | #import "ObjFWRT.h" #import "private.h" #ifdef OF_HAVE_THREADS # import "mutex.h" # define NUM_SPINLOCKS 8 /* needs to be a power of 2 */ # define SPINLOCK_HASH(p) ((unsigned)((uintptr_t)p >> 4) & (NUM_SPINLOCKS - 1)) |
︙ | |||
115 116 117 118 119 120 121 | 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 | - + - + - + - + | objc_getPropertyStruct(void *dest, const void *src, ptrdiff_t size, bool atomic, bool strong) { if (atomic) { #ifdef OF_HAVE_THREADS unsigned hash = SPINLOCK_HASH(src); |
︙ |
Modified src/socket.m from [88d75056c4] to [1838fee786].
︙ | |||
133 134 135 136 137 138 139 | 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 | - + | # endif # if defined(OF_HAVE_THREADS) && (!defined(OF_AMIGAOS) || defined(OF_MORPHOS)) mutex = [[OFMutex alloc] init]; atexit(releaseMutex); # ifdef OF_WII |
︙ |