Differences From Artifact [e7f8997037]:
- File src/OFBlock.m — part of check-in [737a82e1a4] at 2013-02-05 22:24:31 on branch trunk — Move abort() to make old GCCs happy. (user: js, size: 11525) [annotate] [blame] [check-ins using]
To Artifact [84017da3fd]:
- File
src/OFBlock.m
— part of check-in
[8fbc6b4e63]
at
2013-07-04 14:04:38
on branch trunk
— OFBlock: Initialize spinlocks in +[load].
As most blocks are static instances, there's a chance +[initialize] is
never called.As a nice side effect, this also fixes the bug that the spinlocks were
initialized multiple times. (user: js, size: 11503) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
311 312 313 314 315 316 317 | free(obj); } break; } } @implementation OFBlock | < > > > > > > > > > > | | 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 | free(obj); } break; } } @implementation OFBlock + (void)load { #ifndef OF_HAVE_ATOMIC_OPS size_t i; for (i = 0; i < NUM_SPINLOCKS; i++) if (!of_spinlock_new(&spinlocks[i])) @throw [OFInitializationFailedException exceptionWithClass: self]; #endif #ifdef OF_APPLE_RUNTIME Class tmp; # ifdef __OBJC2__ tmp = objc_initializeClassPair(self, "OFStackBlock", (Class)&_NSConcreteStackBlock, (Class)&_NSConcreteStackBlock_metaclass); if (tmp == Nil) @throw [OFInitializationFailedException exceptionWithClass: self]; objc_registerClassPair(tmp); |
︙ | ︙ | |||
368 369 370 371 372 373 374 | if ((tmp = objc_allocateClassPair(self, "OFMallocBlock", 0)) == NULL) @throw [OFInitializationFailedException exceptionWithClass: self]; memcpy(&_NSConcreteMallocBlock, tmp, sizeof(_NSConcreteMallocBlock)); free(tmp); objc_registerClassPair((Class)&_NSConcreteMallocBlock); # endif | < | < < < < < < < < < < < | 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 | if ((tmp = objc_allocateClassPair(self, "OFMallocBlock", 0)) == NULL) @throw [OFInitializationFailedException exceptionWithClass: self]; memcpy(&_NSConcreteMallocBlock, tmp, sizeof(_NSConcreteMallocBlock)); free(tmp); objc_registerClassPair((Class)&_NSConcreteMallocBlock); # endif #endif } + alloc { [self doesNotRecognizeSelector: _cmd]; abort(); } |
︙ | ︙ |